diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/parse_emails.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/python/parse_emails.py b/python/parse_emails.py index 9f33fd6f..4bb44d27 100644 --- a/python/parse_emails.py +++ b/python/parse_emails.py @@ -39,7 +39,11 @@ def makedf(r, indextype, quote_source): df = pd.DataFrame.from_records(r, columns=cols) for col in ['delta_rec', 'delta_pay', 'vol', 'price_vol', 'gamma', 'tail']: if col in df: - df[col] = df[col].str.strip("%").astype('float') / 100 + try: + df[col] = df[col].str.rstrip("%").astype('float') / 100 + except ValueError: #typo in one email + df[col] = (df[col].str.rstrip("%"). + str.replace("n", "").astype("float") / 100) if quote_source == "GS": for col in ["pay_bid", "pay_offer", "rec_bid", "rec_offer"]: df[col] = df[col].str.strip('-') |
