You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Matt, thanks for your book, really enjoying it. I'd suggest a couple of changes in chapter 27:
Within the description of the parameters of method pandas.DataFrame.groupby() at page 322, I'd change the specification of dropna. Indeed, this works differently than the same parameter in pandas.DataFrame.pivot_table() or in function pandas.crosstab(), where it applies to values (and therefore << [...] dropna=False will keep columns that have no values >>). Instead, in pandas.DataFrame.groupby()dropna applies to group keys (the description above - which is specified in the book - is no longer valid). For this reason, the DataFrame at page 305 should have 8 columns, rather than 4.
At pages 313-314 of the book, per column aggregations are not applied on numeric columns only, which we instead may possibly get by typing jb2.groupby('country_live')[[col for col in jb2.select_dtypes('number').columns]].agg(['min', 'max']).
The text was updated successfully, but these errors were encountered:
Hi Matt, thanks for your book, really enjoying it. I'd suggest a couple of changes in chapter 27:
pandas.DataFrame.groupby()
at page 322, I'd change the specification ofdropna
. Indeed, this works differently than the same parameter inpandas.DataFrame.pivot_table()
or in functionpandas.crosstab()
, where it applies to values (and therefore << [...]dropna=False
will keep columns that have no values >>). Instead, inpandas.DataFrame.groupby()
dropna
applies to group keys (the description above - which is specified in the book - is no longer valid). For this reason, the DataFrame at page 305 should have 8 columns, rather than 4.jb2.groupby('country_live')[[col for col in jb2.select_dtypes('number').columns]].agg(['min', 'max'])
.The text was updated successfully, but these errors were encountered: