Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geopandas join returns pandas DataFrame #118

Closed
TaylorOshan opened this issue Jul 11, 2014 · 5 comments
Closed

Geopandas join returns pandas DataFrame #118

TaylorOshan opened this issue Jul 11, 2014 · 5 comments

Comments

@TaylorOshan
Copy link

For exmaple:

boros = gp.read_file("nybb.shp")
populations = pd.read_csv("populations.csv")
populations.set_index('BoroCode', inplace=True)

joined = boros.join(populations, on='BoroCode')
type(joined)

pandas.core.frame.DataFrame

Output should be:

geopandas.geodataframe.GeoDataFrame

population.csv data:

BoroCode,BoroName,Pop
2,Bronx,1385108
3,Brooklyn,2504700
1,Manhattan,1585873
4,Queens,2230722
5,Staten Island,468730
@sgillies
Copy link
Contributor

@TaylorOshan can you add a populations.csv file to the repo?

@jwass
Copy link
Member

jwass commented Jul 12, 2014

@sgillies I'm about to file a PR to pandas on this.

@sgillies
Copy link
Contributor

@jwass Great! Wish you were here.

sgillies pushed a commit that referenced this issue Jul 12, 2014
@jwass
Copy link
Member

jwass commented Jul 12, 2014

@sgillies Me too. Definitely sad to miss the conference, the sprint and meeting everyone. But I'm really happy to see all the progress. Hopefully another time!

@sgillies
Copy link
Contributor

@jwass Meanwhile I have a workaround at 20010c5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants