1

I have 2 dataframes df1 and df2, that are identical in structure:

I ran the following command on each of the dataframes:

df_grouped = df1.set_index("timestamp") # with df2 as well
df_grouped = df_grouped.groupby("doc_sentiment").resample(bin_res).size()
df_grouped = pd.DataFrame(df_grouped)
df_grouped.head()

And the output I received was inconsistent between the dfs. For df1 one the output had the timestamps as the index. This is the expected output.

However, for df2, the output had the timestamps as the columns.

0 Answers0