I am not sure how to solve this error message. I hope someone can help. Thanks.
import numpy as np
from sklearn import linear_model
from sklearn.model_selection import train_test_split
def desired_marketing_expenditure(x_train_marketing_expenditure, y_train_units_sold, x_test_units_sold):
X_train, X_test, y_train, y_test = train_test_split(x_train_marketing_expenditure, y_train_units_sold, test_size=0.4, random_state=101)
lm = linear_model.LinearRegression()
lm.fit(X_train,y_train)
print(lm.intercept_)
print(lm.coef_)
#predictions = lm.predict(x_test_units_sold)
print(desired_marketing_expenditure([300000, 200000, 400000, 300000, 100000],[60000, 50000, 90000, 80000, 30000],60000))
OUT:ValueError: Expected 2D array, got 1D array instead: array=[400000 200000 300000]. Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.