ml-andrewng-python
ml-andrewng-python copied to clipboard
TypeError : iteration over 0-d array
Line number 123 , the usage of size
s = np.array(data.size)
Returns the number of the elements whereas only the elements of column 'size' are required .
It is giving the error - TypeError : iteration over 0-d array
So it is better to change the argument name on line number 122 to anything other than size.
data = pd.read_csv("ex1data2.txt",names=["size","bedrooms","price"])