eshan6704 commited on
Commit
0ee35a1
·
verified ·
1 Parent(s): 9ace307

Update stock.py

Browse files
Files changed (1) hide show
  1. stock.py +5 -1
stock.py CHANGED
@@ -147,8 +147,12 @@ def fetch_intraday(symbol, indicators=None):
147
  def fetch_daily(symbol, source="yfinance", max_rows=200):
148
  try:
149
  df = daily(symbol)
150
- df_disp = df.head(max_rows)
151
 
 
 
 
 
152
  combined_df = talib_df(df_disp)
153
  table_html = combined_df.to_html(
154
  classes="table table-striped table-bordered",
 
147
  def fetch_daily(symbol, source="yfinance", max_rows=200):
148
  try:
149
  df = daily(symbol)
150
+
151
 
152
+ if isinstance(df.columns, pd.MultiIndex):
153
+ df.columns = df.columns.get_level_values(0)
154
+
155
+ df_disp = df.head(max_rows)
156
  combined_df = talib_df(df_disp)
157
  table_html = combined_df.to_html(
158
  classes="table table-striped table-bordered",