Skip to content

Commit f39777d

Browse files
committed
fix: resolve FutureWarning about inplace deprecation
1 parent e6dc2a6 commit f39777d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

convert.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,11 @@ def convert():
108108
input["Name"] = input["Given Name"] + " " + input["Family Name"]
109109

110110
# - replace singular with plural in category
111-
input["Category"].replace(
112-
{"Vlče": "Vlčata", "Skaut": "Skauti", "Rover": "Roveři"}, inplace=True
111+
# Avoid inplace on a Series (pandas will warn about chained assignment).
112+
# Assign the replaced Series back to the DataFrame to ensure we operate
113+
# on the original object (compatible with pandas 3.0 behavior).
114+
input["Category"] = input["Category"].replace(
115+
{"Vlče": "Vlčata", "Skaut": "Skauti", "Rover": "Roveři"}
113116
)
114117

115118
# - and some need bigger changes (combining, renaming and adding values)

0 commit comments

Comments
 (0)