verdbref spurning


Höfundur
Semboy
1+1=10
Póstar: 1143
Skráði sig: Lau 05. Maí 2007 22:28
Reputation: 111
Staða: Ótengdur

verdbref spurning

Pósturaf Semboy » Þri 08. Feb 2022 23:17

Kóði: Velja allt

list_of_yesterday = []
stock_response = requests.get(stock_api_info["end_point"],params=stock_api_info["parameters"])
stock_response.raise_for_status()
stock_data = stock_response.json()

# LETS REMOVE THE TODAYS DATA
def remove_the_todays_data(data):
    today = dt.datetime.now().date()
    # for period in stock_data["Time Series (60min)"]:
    #     period_to_date = dt.datetime.strptime(period, '%Y-%m-%d %H:%M:%S')
    #     if today == period_to_date.date():
    #         continue
    #     else:
    #         new_stock_data[period] = stock_data["Time Series (60min)"][period]
    new_stock_data = {period: data for (period, data) in stock_data["Time Series (60min)"].items() if today != dt.datetime.strptime(period, '%Y-%m-%d %H:%M:%S').date()}

    return new_stock_data


print(stock_data["Time Series (60min)"])
print(remove_the_todays_data(stock_data))


Eg er nybyrjadur ad kynna mer allt um verdbref,aettu their ekki bunir ad loka fyrir kaup og solum af verdbrefum fyrir thennan dag?.


hef ekkert að segja LOL!


Höfundur
Semboy
1+1=10
Póstar: 1143
Skráði sig: Lau 05. Maí 2007 22:28
Reputation: 111
Staða: Ótengdur

Re: verdbref spurning

Pósturaf Semboy » Þri 08. Feb 2022 23:31

nvm, thad er 24 tima seinkun sett a mig, hata fri gogn :).


hef ekkert að segja LOL!