0

I have this type of error when reading a csv file. What does this error tell me? Should I ignore it?

DtypeWarning: Columns (17,62) have mixed types. Specify dtype option on import or set low_memory=False.
  interactivity=interactivity, compiler=compiler, result=result)
Mateen Ulhaq
  • 24,552
  • 19
  • 101
  • 135
MrFapoh
  • 23
  • 5
  • Mixed type means your column data is being parsed as more than one type; e.g. some may be read as an `int` and some as a `str`. – Mateen Ulhaq Apr 21 '20 at 04:39

1 Answers1

1

Besides the fact that there are mixed data types, it is not clear what is specifically causing the issue. Can you post the full error message? Some options are:

  1. Try passing , dtype='unicode' or another dtype when you pd.read_csv(). That's what one user said here: https://github.com/oSoc19/best/issues/87.
  2. You can also get rid of the error by doing what it is telling you to do. Pass ,low_memory=False.

Per the accepted solution in this post: Mixed types when reading csv files. Causes, fixes and consequences

"How exactly does low_memory=False fix the problem? It reads all of the file before deciding the type, therefore needing more memory."

David Erickson
  • 16,433
  • 2
  • 19
  • 35