InNoobWeTrust commited on
Commit
c5f202a
·
1 Parent(s): 2931ce4

fix: timezone issue on streamlit cloud

Browse files
Files changed (1) hide show
  1. df.py +5 -2
df.py CHANGED
@@ -1,4 +1,5 @@
1
  import pandas as pd
 
2
  import yfinance as yf
3
  import streamlit as st
4
 
@@ -118,8 +119,10 @@ def fetch(asset):
118
  df = fetch_eth_etf()
119
 
120
  etf_flow, etf_funds = df.flow, df.funds
121
- etf_volumes = fetch_etf_volumes(etf_funds, start_time = etf_flow.Date[0])
122
- price = fetch_asset_price(f'{asset}-USD', start_time = etf_flow.Date[0])
 
 
123
  price.rename(columns={'Close': 'Price'}, inplace=True)
124
 
125
  etf_flow_individual = etf_flow.drop(columns="Total")
 
1
  import pandas as pd
2
+ import pytz
3
  import yfinance as yf
4
  import streamlit as st
5
 
 
119
  df = fetch_eth_etf()
120
 
121
  etf_flow, etf_funds = df.flow, df.funds
122
+ tz = pytz.timezone('America/New_York')
123
+ start_time = tz.localize(etf_flow.Date[0])
124
+ etf_volumes = fetch_etf_volumes(etf_funds, start_time = start_time)
125
+ price = fetch_asset_price(f'{asset}-USD', start_time = start_time)
126
  price.rename(columns={'Close': 'Price'}, inplace=True)
127
 
128
  etf_flow_individual = etf_flow.drop(columns="Total")