KnowledgeBoat Logo
|

Informatics Practices

While writing a DataFrame onto a CSV file, which argument would you use in to_csv() for NaN values' representation as NULL ?

  1. NaN = NULL
  2. na_rep = NULL
  3. na_value = NULL
  4. na = NULL

Python Pandas

1 Like

Answer

na_rep = NULL

Reason — The na_rep argument in the to_csv() method is used to specify the representation of NaN values in the resulting CSV file. Using na_rep = NULL means that NaN values will be represented as "NULL" in the CSV file.

Answered By

3 Likes


Related Questions