Skip to content

Commit

Permalink
Tentative fix for plot1d and 2d binning with string pd.Interval
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet committed Nov 15, 2023
1 parent 58960b0 commit be64de0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xdem/spatialstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -3301,7 +3301,7 @@ def plot_1d_binning(
raise ValueError(f'The statistic "{statistic_name}" is not part of the provided dataframe column names.')

# Re-format pandas interval if read from CSV as string
if all(isinstance(x, pd.Interval) for x in df[var_name].values):
if any(isinstance(x, pd.Interval) for x in df[var_name].values):
pass
# Check for any unformatted interval (saving and reading a pd.DataFrame without MultiIndexing transforms
# pd.Interval into strings)
Expand Down Expand Up @@ -3435,7 +3435,7 @@ def plot_2d_binning(

# Re-format pandas interval if read from CSV as string
for var in [var_name_1, var_name_2]:
if all(isinstance(x, pd.Interval) for x in df[var].values):
if any(isinstance(x, pd.Interval) for x in df[var].values):
pass
# Check for any unformatted interval (saving and reading a pd.DataFrame without MultiIndexing transforms
# pd.Interval into strings)
Expand Down

0 comments on commit be64de0

Please sign in to comment.