0

thanks for your help! I'm having difficulties preparing my neural network classification.

When trying to fit my model, I get this error:

ValueError: setting an array element with a sequence.

I think I understand why it is. Here's the screenshot of the x_train variable: X_Train

I think it would also be helpful to show you the df I'm pulling this from. I've done text_to_word_sequence and one_hot encoding on it. It looks like... df

It seems to me that the rows need to be split but I'm not sure the best way to do that in a way that will allow the train to properly fit.

Thanks for your help again!

ESarousi
  • 47
  • 7
  • 1
    df.explode('codes') would split row wise. but from the look of your data, you still need more cleaning and processing. consider tokenising and clearing punctuations before before coding – Ade_1 May 23 '21 at 15:38
  • Thanks for responding! So I tried that and it looked to reflect that in the output but when I went to do datadf.head(), it responded with the same thing. I then also tried saving it to a variable and got an error. "ValueError: cannot reindex from a duplicate axis" Any suggestions? – ESarousi May 23 '21 at 16:05
  • hmm, i am assuming you reassigned the new result to a new variable. and not reassigned it to a new column within the same dataframe... https://stackoverflow.com/questions/27236275/what-does-valueerror-cannot-reindex-from-a-duplicate-axis-mean – Ade_1 May 23 '21 at 16:21

0 Answers0