Skip to content

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

@danielduckworth

Description

@danielduckworth

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions