Last time I tried to put a nan
into a Pandas dataframe, it forced me to change the column from type int
to float
.
In SQL there is not an issue with with having a 'NULL' in a column of any type as far as I know. The dataframes I am working with often go in and out of SQL.
Now I have a dataframe with columns including int
, object
and float
and need to create some code which programatically adds a few single rows where 6 out of 7 columns should contain nothing and only 1 out of 7 is assigned a value.
Is there some other standard 'NULL' thing in Pandas you can put in the columns that are not of type float?
This time I definitely can't go and change the type of a column just to put an nan
in it.