-
-
Notifications
You must be signed in to change notification settings - Fork 972
BUG: Do not modify original DataFrame during creation of GeoDataFrame #1324
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
Conversation
Thanks, this seems to do the trick. I am not sure if there would not be some memory related consequences somewhere, but hopefully not. Can you add a test for this? You can just easily use than snippet from the issue and I'll check failing CI, but it is not related. |
Co-Authored-By: Martin Fleischmann <martin@martinfleischmann.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sangarshanan Thanks for looking at this!
This clearly fixes the original (and buggy!) case, which is nice.
I am only wondering what the consequences are for other cases. For example, in pandas, creating a dataframe from a dataframe does not copy. Similarly, right now, GeoDataFrame(gdf)
also does not create a copy (I need to think a bit more about this ..).
Also related to pandas-dev/pandas#29309
This may be related to or affected by pandas-dev/pandas#38939. I think I like having the option of making a copy of the original dataframe or not. |
I will close this in favour of #2306, that implements a bit smarter solution. We can continue our discussion there. Thanks for looking into that @Sangarshanan! |
Fixes #1179
Make modification to the copy of the data instead of the original,