0

I have two numpy.ndarrays: Y_train and Y_pred_train. Both are of the shape (799, 1).

The following line of code returns an exception 'If using all scalar values, you must pass an index':

df_train = pd.DataFrame(data = {'Y_Actual_train' : Y_train, 'Y_Pred_train' : Y_pred_train})

But these arrays are not scallars or what. I don't understand.

AMC
  • 2,642
  • 7
  • 13
  • 35
  • 2
    `{'Y_Actual_train' : Y_train.squeeze(), ...` – RichieV Aug 31 '20 at 23:36
  • Please provide the entire error output, as well as a [mcve]. – AMC Sep 01 '20 at 01:09
  • Does this answer your question? [Constructing pandas DataFrame from values in variables gives "ValueError: If using all scalar values, you must pass an index"](https://stackoverflow.com/questions/17839973/constructing-pandas-dataframe-from-values-in-variables-gives-valueerror-if-usi) – AMC Sep 01 '20 at 01:10

0 Answers0