ValueError: x and y must be the same size

后端 未结 4 1673
抹茶落季
抹茶落季 2020-12-11 03:16
import numpy as np
import pandas as pd
import matplotlib.pyplot as pt

data1 = pd.read_csv(\'stage1_labels.csv\')

X = data1.iloc[:, :-1].values
y = data1.iloc[:, 1]         


        
4条回答
  •  情书的邮戳
    2020-12-11 04:00

    Print X_train shape. What do you see? I'd bet X_train is 2d (matrix with a single column), while y_train 1d (vector). In turn you get different sizes.

    I think using X_train[:,0] for plotting (which is from where the error originates) should solve the problem

提交回复
热议问题