AllenDowney / ThinkStats2

Text and supporting code for Think Stats, 2nd Edition
http://allendowney.github.io/ThinkStats2/
GNU General Public License v3.0
4.03k stars 11.31k forks source link

Update nsfg2.py #106

Closed yongduek closed 6 years ago

yongduek commented 6 years ago

The warning message below will be removed:

nsfg2.py:57: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy df.birthwgt_lb1[df.birthwgt_lb1 > 20] = np.nan


cf: How to deal with SettingWithCopyWarning in Pandas?

AllenDowney commented 6 years ago

Thank you!