Python Forum
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
groupby question
#3
(Mar-29-2017, 09:11 PM)zivoni Wrote:
 df.groupby('Month').count() 
returns pandas serie with length equal to a number of unique items in df['Month'] column (these form index, values are items counts). So serie with aggregated values is usually "shorter" than length of original dataframe (unless there are only unique items in the Month column), and you cant assign it as a new column.

Thank you for helping me understand the concept.
Reply


Messages In This Thread
groupby question - by smw10c - Mar-29-2017, 08:39 PM
RE: groupby question - by zivoni - Mar-29-2017, 09:11 PM
RE: groupby question - by smw10c - Mar-29-2017, 11:17 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020