pandas concat ignore_index doesn't work

前端 未结 4 540
误落风尘
误落风尘 2020-12-04 11:06

I am trying to column-bind dataframes and having issue with pandas concat, as ignore_index=True doesn\'t seem to work:

df1 = pd.Dat         


        
4条回答
  •  遥遥无期
    2020-12-04 11:57

    Thanks for asking. I had the same issue. For some reason "ignore_index=True" doesn't help in my case. I wanted to keep index from the first dataset and ignore the second index a this worked for me

    X_train=pd.concat([train_sp, X_train.reset_index(drop=True, inplace=True)], axis=1)
    

提交回复
热议问题