Skip to content

QST: Why does Pandas change data type from object to float after reading 32768 rows from CSV file? #36103

@dwervin

Description

@dwervin
  • I have searched the [pandas] tag on StackOverflow for similar questions.

  • I have asked my usage related question on StackOverflow.


Question about pandas

Using Pandas 1.0.3.

I have a CSV with 43,00 rows. I noticed that one of the columns is object type even though it has floats. It looks like this happened because a few records contain a string that reads 'Bad Input'. However, after 32768 rows, the data becomes floats. I found it strange that this happens after exactly 32K rows.

I've used Pandas for a few years now, but I've never seen an inconsistency like this.

Is this a bug? How do I work around this?

Note: If you'd still like to submit a question, please read this guide detailing how to provide the necessary information for us to reproduce your question.

# Your code here, if applicable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions