[Python] Is there a way to allow NaN values to be writen to CSV from panadas?

Discussão em 'Python' iniciado por Stack, Maio 24, 2025.

  1. Stack

    Stack Membro Participativo

    I have the following error builtins.AssertionError: 12 columns passed, passed data had 6 columns The last 6 Columns datawise will vary so Im happy to have None in the areas the data is missing. However I cant seem to find a simple way to do this, I'm pretty sure there must be an option for it but I cant see it in the docs or any google searches.

    Any help would be appreciated. I would like to reiterate that I know what is causing the problem and I know data is missing from columns. I would like to ignore missing data and I am happy to have None or NaN in the output csv.

    Continue reading...

Compartilhe esta Página