From 300ffb2e2129c6600af136a2ab0a8da9a9d5039b Mon Sep 17 00:00:00 2001 From: Abhishek Amar <66067391+abhishek-amar@users.noreply.github.com> Date: Sun, 22 Oct 2023 15:09:52 +0530 Subject: [PATCH] fix: A value is trying to be set on a copy of a slice from a DataFrame #5582 --- openbb_terminal/stocks/fundamental_analysis/fmp_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbb_terminal/stocks/fundamental_analysis/fmp_model.py b/openbb_terminal/stocks/fundamental_analysis/fmp_model.py index 6406c072b320..bbec51931d90 100644 --- a/openbb_terminal/stocks/fundamental_analysis/fmp_model.py +++ b/openbb_terminal/stocks/fundamental_analysis/fmp_model.py @@ -647,7 +647,7 @@ def clean_metrics_df(data: pd.DataFrame, num: int, mask: bool = False) -> pd.Dat """ # iloc will fail if number is greater than number of columns num = min(num, data.shape[1]) - data = data.iloc[:, 0:num] + data = data.iloc[:, 0:num].copy() if mask: data = data.mask(data.astype(object).eq(num * ["None"])).dropna()