0

I am trying to combine a series with a dataframe (column-wise):

xray_XY_ok =  pd.concat([xray[xray.columns[0]], xray_X_ok], axis=1, ignore_index = True)

but I got the following error:

ValueError: Shape of passed values is (7808, 51), indices imply (6496, 51)

but the two datas' shapes are of the following:

xray_X_ok.shape
(5856, 50)
xray[xray.columns[0]].shape
(5856,)
lll
  • 1,049
  • 2
  • 13
  • 39
  • https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples – Paul H May 05 '20 at 22:49
  • My *guess* is that your index isn't unique, so it's ambiguous how the dataframes should align – Paul H May 05 '20 at 22:50

0 Answers0