I want to sort/groupby/concatenate data in a list by date, but without changing the order. I have the following list stored in
loop_1 = []
and the sample data in loop_1 is the following:
I want to achieve this:
I've tried:
df = pd.concat(loop_1,axis=1)
also:
df = pd.concat(loop_1)
df.reset_index(inplace=True)
df = df.groupby(['date']).first()
also:
df = pd.concat(loop_1)
df.reset_index(inplace=True)
df = df.groupby(['date'] sort=False).first()
but still cannot achieve the desired result.