I know this is an ancient question and I have searched all previous posts but cannot quite find answers that address my specific question.
I am dealing with a dataframe that looks like this
Date Position Value
2010-01-01 PEAK 600
2010-01-01 BOTTOM 510
2010-01-02 PEAK 620
2010-01-02 BOTTOM 500
...
2015-03-02 PEAK 700
which contains no nan values or weird characters. However, the original data is not of "date" format, so I converted it to "date" format using
df1 = df.sort('Date')
df1['Date'] = pd.to_datetime(df1['Date'])
but after I tried to group my dataframe using groupby() command
df1.groupby('Date')
before grouping the "Position" column and performing calculation on "Value," I keep getting error message that shows
<pandas.core.groupby.DataFrameGroupBy object at 0x7f880d4f2160>
but nothing generated.
I was expecting my code would group all row entries with the same datetime value together, but this didn't turn out that way.
I would greatly appreciate if someone could shed some light on this.
Thank you.