Professional Documents
Culture Documents
Codesss 101
Codesss 101
data = pd.read_csv('_.csv')
data
x = data.Quantity
y = data.UnitPrice
plt.plot(data.Quantity, data.UnitPrice)
plt.xlabel('Quantity')
plt.ylabel('UnitPrice')
Y = data.iloc[:, 1].values.reshape(-1, 1) # -1 means that calculate the dimension of rows, but have 1
column
plt.scatter(X, Y)
plt.show()
data.corr(method = "pearson")
m = linear_regressor.coef_
print(m)
c = linear_regressor.intercept_
print(c)
predict = 100
y = c + m * predict
print(y)