wesm / pydata-book

Materials and IPython notebooks for "Python for Data Analysis" by Wes McKinney, published by O'Reilly Media
Other
22.29k stars 15.2k forks source link

Chapter14 USa.gov Data from Bitly Problem #99

Closed Arsim2 closed 6 years ago

Arsim2 commented 6 years ago

Before final plot of data i tried sorting the values my own way, and ended up with different results

agg_counts = agg_counts.sort_values(by=['Not Windows','Windows'],ascending=False).head(10) agg_counts agg_counts.sum(1).sort_values(ascending=False) Results in different output why? This is what i obtain, before final plot tz America/New_York 1251.0 521.0 America/Chicago 400.0 America/Los_Angeles 382.0 America/Denver 191.0 Europe/London 74.0 Europe/Madrid 35.0 America/Sao_Paulo 33.0 America/Rainy_River 25.0 Europe/Amsterdam 22.0 But, if i use agrsort(), as prescribed in the book the result is a bit different, i have placed * on different tz

tz America/New_York 1251.0 521.0 America/Chicago 400.0 America/Los_Angeles 382.0 America/Denver 191.0 Europe/London 74.0 Asia/Tokyo 37.0 Pacific/Honolulu 36.0 Europe/Madrid 35.0 America/Sao_Paulo 33.0 dtype: float64

Arsim2 commented 6 years ago

Assigning .head() earlier ! :-)