GoBlue_MathMan GoBlue_MathMan - 6 months ago 30
Python Question

Python Pandas Group by date using datetime data

I have a column

that I wish to groupby date time without creating a new column. Is this possible the current code I have does not work.

df = pd.groupby(df,by=[df['Date_Time'].date()])


Credit to @jezrael for his setup dataframe

You can set the index to be 'Date_Time' and use pd.TimeGrouper


enter image description here