I have a dataframe in Python that I want to save as a CSV with this line:
df.to_csv(PATH, quoting = csv.QUOTE_NONNUMERIC, index = False)
The dataframe has this form:
date timeOfDay GridID score
2015-12-31 Morning 1445 0.000000
And the result after that piece of code is:
date,timeOfDay,GridID,score
"2015-01-01","Morning",1445,"0.0"
But I don't understand why score is quoted when the code has csv.QUOTE_NONNUMERIC while it is a numpy.float64. Indeed, GridID is stored successfully.
EDIT: If only score is stored in the csv file and anything else, the values are float, not quoted. Only if I add just a column then score is quoted again.