#Collecting Data from these columns
X = dataframe['Primary Type'].value_counts().loc['THEFT']
y = dataframe['Year'].value_counts()
#Dividing Data into Test and Train
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 0)
#Trainng the Algorithm
regressor = LinearRegression()
regressor.fit(X_train, y_train)
#Making the Predictions
y_pred = regressor.predict(X_test)
#In the form of table
df= pd.DataFrame({'Actual': y_test, 'Predict': y_pred})
print (df)
I am getting an type error while training a model. I am not getting this how can I overcome on this problem. X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 0) on this statement I am getting problem. Please help me out.