From d93c4d82eca743c4d14f757292f5b53f5b875214 Mon Sep 17 00:00:00 2001 From: Filippos Zofakis Date: Fri, 20 Dec 2024 17:24:28 +0000 Subject: [PATCH] Fixing setting with copy warning when using inplace with forward fill --- quantstats/_plotting/core.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/quantstats/_plotting/core.py b/quantstats/_plotting/core.py index 8cf55c31..22dccd21 100644 --- a/quantstats/_plotting/core.py +++ b/quantstats/_plotting/core.py @@ -1013,16 +1013,16 @@ def plot_distribution( apply_fnc = _stats.comp if compounded else _np.sum port["Weekly"] = port["Daily"].resample("W-MON").apply(apply_fnc) - port["Weekly"].ffill(inplace=True) + port["Weekly"] = port["Weekly"].ffill() port["Monthly"] = port["Daily"].resample("ME").apply(apply_fnc) - port["Monthly"].ffill(inplace=True) + port["Monthly"] = port["Monthly"].ffill() port["Quarterly"] = port["Daily"].resample("QE").apply(apply_fnc) - port["Quarterly"].ffill(inplace=True) + port["Quarterly"] = port["Quarterly"].ffill() port["Yearly"] = port["Daily"].resample("YE").apply(apply_fnc) - port["Yearly"].ffill(inplace=True) + port["Yearly"] = port["Yearly"].ffill() fig, ax = _plt.subplots(figsize=figsize) ax.spines["top"].set_visible(False)