From b071a0aae708324c4cf2b4c7b4e7d3cb089aaebb Mon Sep 17 00:00:00 2001 From: Colin Delahunty <72827203+colin99d@users.noreply.github.com> Date: Sun, 17 Oct 2021 17:09:57 -0400 Subject: [PATCH] Added handling for >$5,000,000 - solves #816 (#819) * Added handling for >,000,000 * black Co-authored-by: Colin Delahunty --- .pre-commit-config.yaml | 2 +- .../stocks/government/quiverquant_view.py | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 132d4a82a05..811fe787de4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: - id: check-merge-conflict - id: detect-private-key - repo: https://github.com/psf/black - rev: 21.7b0 + rev: 21.9b0 hooks: - id: black - repo: https://github.com/pycqa/flake8 diff --git a/gamestonk_terminal/stocks/government/quiverquant_view.py b/gamestonk_terminal/stocks/government/quiverquant_view.py index 1b6d550ae51..3284dfdd9e1 100644 --- a/gamestonk_terminal/stocks/government/quiverquant_view.py +++ b/gamestonk_terminal/stocks/government/quiverquant_view.py @@ -250,12 +250,22 @@ def display_government_sells( df_gov = df_gov[df_gov["TransactionDate"] > start_date].dropna() df_gov["min"] = df_gov["Range"].apply( - lambda x: x.split("-")[0].strip("$").replace(",", "").strip() + lambda x: x.split("-")[0] + .strip("$") + .replace(",", "") + .strip() + .replace(">$", "") + .strip() ) df_gov["max"] = df_gov["Range"].apply( - lambda x: x.split("-")[1].replace(",", "").strip().strip("$") + lambda x: x.split("-")[1] + .replace(",", "") + .strip() + .strip("$") + .replace(">$", "") + .strip() if "-" in x - else x.strip("$").replace(",", "") + else x.strip("$").replace(",", "").replace(">$", "").strip() ) df_gov["lower"] = df_gov[["min", "max", "Transaction"]].apply(