eshan6704 commited on
Commit
9d9865a
·
verified ·
1 Parent(s): e5a4607

Update daily.py

Browse files
Files changed (1) hide show
  1. daily.py +3 -1
daily.py CHANGED
@@ -11,7 +11,9 @@ def fetch_daily(symbol):
11
  try:
12
  # --- Fetch historical data ---
13
  df = yf.download(symbol + ".NS", period="1y", interval="1d").round(2)
14
- df.columns=df.co
 
 
15
  if df.empty:
16
  return html_card("Error", f"No daily data found for {symbol}")
17
  df.reset_index(inplace=True)
 
11
  try:
12
  # --- Fetch historical data ---
13
  df = yf.download(symbol + ".NS", period="1y", interval="1d").round(2)
14
+ # Reset MultiIndex if exists
15
+ if isinstance(df.columns, pd.MultiIndex):
16
+ df.columns = df.columns.get_level_values(0)
17
  if df.empty:
18
  return html_card("Error", f"No daily data found for {symbol}")
19
  df.reset_index(inplace=True)