Partitioning data into features/labels and train/test after reading from csv file
I don't know exactly how your data is but y = data.temp may be a Series containing the string values which should be cast to float values. Try to change it to the following alternative.


  y = data.temp.astype(float)