Machine-Learning-with-Python
Machine-Learning-with-Python copied to clipboard
TypeError: object of type 'numpy.int64' has no len()
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()