pos_log = pd.concat([trade_logs[trade_logs.index.map(lambda x: x%2==0)].reset_index(), trade_logs[trade_logs.index.map(lambda x: x%2==1)].reset_index()], axis=1).drop(columns=['index'])
return pos_log
Every time when I run the function index or level_0 keeps on adding as a column to pos_log dataframe.
I tried reset_index(drop=True).