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]
Slicing with [:, :-1] will give you a 2-dimensional array (including all rows and all columns excluding the last column).
Slicing with [:, 1] will give you a 1-dimensional array (including all rows from the second column). To make this array also 2-dimensional use [:, 1:2] or [:, 1].reshape(-1, 1) or [:, 1][:, None] instead of [:, 1]. This will make x and y comparable.
An alternative to making both arrays 2-dimensional is making them both one dimensional. For this one would do [:, 0] (instead of [:, :1]) for selecting the first column and [:, 1] for selecting the second column.