Skip to content

Commit 520ca19

Browse files
removing old redundant code that is causing SettingWithCopyWarning
1 parent da38bc4 commit 520ca19

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

gspread_pandas/util.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import warnings
2-
from distutils.version import StrictVersion
32
from re import match
43
from time import sleep
54

@@ -217,13 +216,7 @@ def fillna(df, fill_value=""):
217216
"""
218217
for col in df.dtypes[df.dtypes == "category"].index:
219218
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])
227220
return df.fillna(fill_value)
228221

229222

0 commit comments

Comments
 (0)