I have a df below as:
Day
Morning
Day
Night
Night
Day
Morning
Day
Day
There are other columns in the this df and does not only contain the above column
when I run code below as:
df.groupby('day').count()
it outputs a df with the count of times each value for day column occurs in the other columns in the df ( its the same count number for each value in the day column)
How can I create a new column that lists those same counts for each value of the Day column?
Expected output:
Day New_Col
Morning 2
Day 4
Night 2
Night 2
Day 4
Morning 2
Day 4
Day 4
Thanks!