datacarpentry / python-ecology-lesson

Data Analysis and Visualization in Python for Ecologists
https://datacarpentry.org/python-ecology-lesson
Other
160 stars 310 forks source link

Add .copy() before fillna() #419

Closed Benfeitas closed 4 years ago

Benfeitas commented 5 years ago

Add .copy() to avoid changing the original dataframe surveys_df.

See the issue and motivation

maxim-belkin commented 4 years ago

@Benfeitas, thank you for your (first) pull request to the lesson!

Unfortunately, it looks like .copy() is not necessary here as .fillna() creates a copy of the dataframe (unless we specify inplace=True). Therefore, I'm going to pass on this PR. Please feel free to open a new issue if you think we should add .copy() or if we should talk more about it (explain it better) -- I'd be happy to discuss this further.

With that, thanks again and hope to see your next PR / issue soon!