Skip to content

Commit

Permalink
ignores the FutureWarning issued due to pandas 2.1.0 malfunction
Browse files Browse the repository at this point in the history
  • Loading branch information
johentsch committed Oct 19, 2023
1 parent d328ef5 commit 5cf9864
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/ms3/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,12 @@ def expand_dcml(
# Setting values in-place is fine, ignore the warning in Pandas >= 1.5.0
# This can be removed, if Pandas 1.5.0 does not need to be supported any longer.
# See also: https://stackoverflow.com/q/74057367/859591
# addition: pandas 2.1.0 throws "FutureWarning: Setting an item of incompatible dtype is
# deprecated and will raise in a future error of pandas." because all new columns are interpreted
# seem to default to dtype float64.
warnings.filterwarnings(
"ignore",
category=FutureWarning,
message=(
".*will attempt to set the values inplace instead of always setting a new array. "
"To retain the old behavior, use either.*"
),
)
df.loc[select_dcml, exp.columns] = exp
df.loc[:, key_cols] = df[key_cols].ffill()
Expand Down

0 comments on commit 5cf9864

Please sign in to comment.