fix date formatting

This commit is contained in:
Hinko Kocevar
2021-04-19 00:12:33 +02:00
parent e9b5c2262c
commit 84c80be012

View File

@@ -3,6 +3,7 @@ __docformat__ = "numpy"
import argparse
from typing import List
from datetime import datetime
import requests
import pandas as pd
from bs4 import BeautifulSoup
@@ -79,6 +80,9 @@ def fails_to_deliver(other_args: List[str], ticker: str):
ftds_data = ftds_data.sort_values("SETTLEMENT DATE", ascending=False)[
0 : ns_parser.n_num
]
ftds_data["SETTLEMENT DATE"] = ftds_data["SETTLEMENT DATE"].apply(
lambda x: datetime.strptime(str(x), "%Y%m%d").strftime("%Y-%m-%d")
)
print(
ftds_data.rename(
columns={"SETTLEMENT DATE": "Date", "QUANTITY (FAILS)": "Quantity"}