Open githubbla opened 3 months ago
`!pip install yfinance==0.2.42 --upgrade --no-cache-dir import yfinance as yf
df2 = yf.download(["SPY","QQQ"], "2023-01-01", "2023-12-31", auto_adjust=True,ignore_tz = True) df = yf.download("QQQ", "2023-01-01", "2023-12-31", auto_adjust=True,ignore_tz = True)
def check_datetime_tz(dt): if dt.tzinfo is None: return "Naive" elif dt.tzinfo.utcoffset(dt) is None: return "Naive" else: return "Timezone-aware"
print("\ndf2=",check_datetime_tz(df2.index[0]))
print("df=",check_datetime_tz(df.index[0])) `
`!pip install yfinance==0.2.42 --upgrade --no-cache-dir import yfinance as yf
df2 = yf.download(["SPY","QQQ"], "2023-01-01", "2023-12-31", auto_adjust=True,ignore_tz = True) df = yf.download("QQQ", "2023-01-01", "2023-12-31", auto_adjust=True,ignore_tz = True)
def check_datetime_tz(dt): if dt.tzinfo is None: return "Naive" elif dt.tzinfo.utcoffset(dt) is None: return "Naive" else: return "Timezone-aware"
print("\ndf2=",check_datetime_tz(df2.index[0]))
print("df=",check_datetime_tz(df.index[0])) `