Machine-Learning-with-Python icon indicating copy to clipboard operation
Machine-Learning-with-Python copied to clipboard

TypeError: object of type 'numpy.int64' has no len()

Open danielduckworth opened this issue 6 years ago • 0 comments

I'm getting the error 'TypeError: object of type 'numpy.int64' has no len()' for the last section of code.

My data file doesn't have column headings to I used 'header=None' when reading the csv file.

My data file also uses integers as the labels rather than text.

#Load data file from from GCS %gcs read --object "gs://projectname/data/data.csv" --variable csv_as_bytes df = pd.read_csv(BytesIO(csv_as_bytes), header=None, encoding='latin-1') df.head()

danielduckworth avatar Mar 08 '18 02:03 danielduckworth