Skip to content

Commit c049961

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

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

gspread_pandas/util.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,7 @@ def fillna(df, fill_value=""):
217217
"""
218218
for col in df.dtypes[df.dtypes == "category"].index:
219219
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")
220+
df[col] = df[col].cat.add_categories([fill_value])
227221
return df.fillna(fill_value)
228222

229223

0 commit comments

Comments
 (0)