Update comment regarting NaT replacement
This commit is contained in:
parent
2e41d80a2c
commit
af984bdc0d
@ -969,9 +969,7 @@ class RPC:
|
|||||||
datetime_types = ['datetime', 'datetime64', 'datetime64[ns, UTC]']
|
datetime_types = ['datetime', 'datetime64', 'datetime64[ns, UTC]']
|
||||||
date_columns = dataframe.select_dtypes(include=datetime_types)
|
date_columns = dataframe.select_dtypes(include=datetime_types)
|
||||||
for date_column in date_columns:
|
for date_column in date_columns:
|
||||||
# replace NaT with empty string,
|
# replace NaT with `None`
|
||||||
# because if replaced with `None`
|
|
||||||
# it will be casted into NaT again
|
|
||||||
dataframe[date_column] = dataframe[date_column].astype(object).replace({NaT: None})
|
dataframe[date_column] = dataframe[date_column].astype(object).replace({NaT: None})
|
||||||
|
|
||||||
dataframe = dataframe.replace({inf: None, -inf: None, NAN: None})
|
dataframe = dataframe.replace({inf: None, -inf: None, NAN: None})
|
||||||
|
Loading…
Reference in New Issue
Block a user