[Python] Pandas read_csv: low_memory and dtype options

Discussão em 'Python' iniciado por Stack, Fevereiro 4, 2025.

  1. Stack

    Stack Membro Participativo

    df = pd.read_csv('somefile.csv')


    ...gives an error:


    .../site-packages/pandas/io/parsers.py:1130: DtypeWarning: Columns (4,5,7,16) have mixed types. Specify dtype option on import or set low_memory=False.
    ​

    Why is the dtype option related to low_memory, and why might low_memory=False help?

    Continue reading...

Compartilhe esta Página