import numpy as np
import matplotlib.pyplot as plt
#载入数据
data=np.genfromtxt(data.csv,delimiter=,)
x_data=data[:,0]
y_data=data[:,-1]
plt.scatter(x_data,y_data)
plt.show()
print(x_data.shape)
#数据中心化
def zeroMean(dataMat):
#按列求平均,即各个特征的平均
meanVal=np.mean(dataMat,axis=0)
newData=dataMat
1