[Python] Pandas read_csv, load empty/missing column values as NaN while loading empty string...

Discussão em 'Python' iniciado por Stack, Agosto 28, 2025.

  1. Stack

    Stack Membro Participativo

    My csv file contains empty string "" as well as missing column values ,,. When i am loading with read_csv(), both are loaded as either empty string or NaN depending on keep_default_na and na_values configuration. I want to distinguish between these two different values such that missing column value is loaded as NaN and empty quoted string as Empty String.

    id,name,age
    1,,"25"
    2,"",3
    3,John,

    Continue reading...

Compartilhe esta Página