Added handling for >$5,000,000 - solves #816 (#819)

* Added handling for >,000,000

* black

Co-authored-by: Colin Delahunty <colindelahunty@Colins-Air.indiana.edu>
This commit is contained in:
Colin Delahunty
2021-10-17 17:09:57 -04:00
committed by GitHub
parent 27889f121e
commit b071a0aae7
2 changed files with 14 additions and 4 deletions

View File

@@ -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

View File

@@ -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(