From 3d7735f6d0aed434ef962bd25c8ce751e7b62fee Mon Sep 17 00:00:00 2001 From: quant Date: Wed, 18 Dec 2024 20:05:29 +0500 Subject: [PATCH] fix FutureWarning: ChainedAssignmentError, refactoring --- tests/test_plotting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_plotting.py b/tests/test_plotting.py index 0a6c88e6b..391584450 100644 --- a/tests/test_plotting.py +++ b/tests/test_plotting.py @@ -172,7 +172,7 @@ def test_line_color_fill_between_interpolate(plot_df): ] df.loc[len(df) + 1] = newdata columns_ = ['model', 'scenario', 'region', 'variable', 'unit', 'year'] - df = df.drop_duplicates(subset=columns_) + df = df.drop_duplicates(subset=columns_).reset_index(drop=True) df = pyam.IamDataFrame(df) df.plot(ax=ax, color="model", fill_between=True, legend=True) return fig