Closed benjaminEwhite closed 8 years ago
I just pushed e87b2a391324cc28a3730d374ac2894094db18f6 to fix this. Thanks!
Glad to be of help @AllenDowney . Thanks for making this text publicly available. As I work through the materials, I'll post issues if I come across anything else.
Thanks!
On Tue, Dec 1, 2015 at 2:46 PM, Benjamin E White notifications@github.com wrote:
Glad to be of help @AllenDowney https://github.com/AllenDowney . Thanks for making this text publicly available. As I work through the materials, I'll post issues if I come across anything else.
— Reply to this email directly or view it on GitHub https://github.com/AllenDowney/ThinkStats2/pull/33#issuecomment-161075320 .
When running the first cell in 1.9 exercises in ipython notebook, the
nsfg.ReadFemPreg
fails when callingCleanFemPreg
with aSettingWithCopyWarning
warning. In ipython notebook, this warning is displayed in a prominent red box, and is the first cell a reader runs.Pandas docs advise against chained indexing for value assignment here.
This patch uses
df.loc
to get rid of the warning and updates book text accordingly. Even though there may be a desire to hold of on introducing.loc()
until later (although I don't think it's harder or easier to understand than chained indexing), it seems to me it's worth it to help beginner users out by making their first experience running code from this book smoother.