File tree Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change 1
1
import warnings
2
- from distutils .version import StrictVersion
3
2
from re import match
4
3
from time import sleep
5
4
@@ -217,13 +216,7 @@ def fillna(df, fill_value=""):
217
216
"""
218
217
for col in df .dtypes [df .dtypes == "category" ].index :
219
218
if fill_value not in df [col ].cat .categories :
220
- df [col ].cat .add_categories ([fill_value ], inplace = True )
221
- # Known bug https://github.com/pandas-dev/pandas/issues/25472
222
- if StrictVersion (pd .__version__ ) >= StrictVersion ("1.0" ):
223
- for col in df .dtypes [
224
- df .dtypes .apply (lambda x : x in ["float64" , "int16" ])
225
- ].index :
226
- df [col ] = df [col ].astype ("float" )
219
+ df [col ] = df [col ].cat .add_categories ([fill_value ])
227
220
return df .fillna (fill_value )
228
221
229
222
You can’t perform that action at this time.
0 commit comments