eshan6704 commited on
Commit
17164cf
·
verified ·
1 Parent(s): 35319f7

Update app/stock.py

Browse files
Files changed (1) hide show
  1. app/stock.py +5 -3
app/stock.py CHANGED
@@ -79,7 +79,7 @@ def fetch_intraday(symbol, indicators=None,b2_save=False):
79
  if b2_save:
80
  b2.upload_file("eshanhf", f"intraday/{symbol}.csv", df)
81
 
82
- df_display = df.tail(50).copy()
83
  df_display.reset_index(inplace=True)
84
 
85
  html = wrap_html(
@@ -112,11 +112,13 @@ def fetch_daily(symbol,date_end,b2_save=False):
112
  df = daily(symbol)
113
  if df is None or df is False or df.empty:
114
  return wrap_html(f"<h1>No daily data for {symbol}</h1>")
115
-
 
 
116
  if b2_save:
117
  b2.upload_file("eshanhf", f"intraday/{symbol}.csv", df)
118
 
119
- df_display = df.tail(50).copy()
120
  df_display.reset_index(inplace=True)
121
 
122
  html = wrap_html(
 
79
  if b2_save:
80
  b2.upload_file("eshanhf", f"intraday/{symbol}.csv", df)
81
 
82
+ df_display = df.copy()
83
  df_display.reset_index(inplace=True)
84
 
85
  html = wrap_html(
 
112
  df = daily(symbol)
113
  if df is None or df is False or df.empty:
114
  return wrap_html(f"<h1>No daily data for {symbol}</h1>")
115
+ if isinstance(df.columns, pd.MultiIndex):
116
+ df.columns = df.columns.get_level_values(0)
117
+
118
  if b2_save:
119
  b2.upload_file("eshanhf", f"intraday/{symbol}.csv", df)
120
 
121
+ df_display = df.copy()
122
  df_display.reset_index(inplace=True)
123
 
124
  html = wrap_html(