From b5ec95d79ee9f6a4ba1d5c88bdeeb58f5338fa82 Mon Sep 17 00:00:00 2001 From: raghavendra Date: Mon, 6 Mar 2023 22:49:54 +0530 Subject: [PATCH 1/2] Fixes #4351 - Data displays in chronological order(recent to older) and correct Insider name --- openbb_terminal/stocks/insider/businessinsider_model.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openbb_terminal/stocks/insider/businessinsider_model.py b/openbb_terminal/stocks/insider/businessinsider_model.py index 5fd0f21f25b4..52537c9d2a37 100644 --- a/openbb_terminal/stocks/insider/businessinsider_model.py +++ b/openbb_terminal/stocks/insider/businessinsider_model.py @@ -60,8 +60,6 @@ def get_insider_activity(symbol: str) -> pd.DataFrame: ) df_insider["Date"] = pd.to_datetime(df_insider["Date"]) - df_insider = df_insider.set_index("Date") - df_insider = df_insider.sort_index(ascending=True) l_names = list() for s_name in text_soup_market_business_insider.findAll( @@ -69,5 +67,6 @@ def get_insider_activity(symbol: str) -> pd.DataFrame: ): l_names.append(s_name.text.strip()) df_insider["Insider"] = l_names - + df_insider = df_insider.set_index("Date") + df_insider = df_insider.sort_index(ascending=False) return df_insider From 578d705d90bf2caa03bf35df098987a6a264eb8b Mon Sep 17 00:00:00 2001 From: raghavendra Date: Tue, 7 Mar 2023 08:45:25 +0530 Subject: [PATCH 2/2] Revert chronological sorting to reverse order --- openbb_terminal/stocks/insider/businessinsider_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbb_terminal/stocks/insider/businessinsider_model.py b/openbb_terminal/stocks/insider/businessinsider_model.py index 52537c9d2a37..a93cad6c9096 100644 --- a/openbb_terminal/stocks/insider/businessinsider_model.py +++ b/openbb_terminal/stocks/insider/businessinsider_model.py @@ -68,5 +68,5 @@ def get_insider_activity(symbol: str) -> pd.DataFrame: l_names.append(s_name.text.strip()) df_insider["Insider"] = l_names df_insider = df_insider.set_index("Date") - df_insider = df_insider.sort_index(ascending=False) + df_insider = df_insider.sort_index(ascending=True) return df_insider