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

BUG: explode() fails if 'level_1' is in columns #1445

Merged
merged 4 commits into from May 27, 2020

Conversation

martinfleis
Copy link
Member

Fixes #1393

If there is a column 'level_1' present in GeoDataFrame, it will fail with NotImplementedError. We are using automatically created level_1 column within explode, so I am renaming potentially conflicting column to '__level_1' and then back.

@martinfleis martinfleis added this to the 0.8.0 milestone May 24, 2020
Comment on lines +679 to +680
if not PANDAS_GE_024:
expected_df = expected_df[["level_1", "geometry"]]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's some strange behaviour for old pandas, switching the order of columns, so I am switching it back.

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good!

@jorisvandenbossche jorisvandenbossche merged commit 4ff0fc6 into geopandas:master May 27, 2020
@martinfleis martinfleis deleted the explode_1393 branch May 27, 2020 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: explode() fails if 'level_1' is in columns
2 participants