eshan6704 commited on
Commit
ecffcb0
·
verified ·
1 Parent(s): 5d6aa98

Update nsepython.py

Browse files
Files changed (1) hide show
  1. nsepython.py +2 -1
nsepython.py CHANGED
@@ -239,7 +239,8 @@ def nse_csv_fetch(url):
239
  # ------------------------- INDEX HIGH-LOW CSV -------------------------
240
  def nse_highlow(date_str):
241
  url="https://archives.nseindia.com/content/indices/" f"ind_close_all_{date_str}.csv"
242
- return pd.DataFrame(nse_csv_fetch(url))
 
243
 
244
  # ------------------------- STOCK 52-WEEK HIGH-LOW CSV -------------------------
245
  def stock_highlow(date_str):
 
239
  # ------------------------- INDEX HIGH-LOW CSV -------------------------
240
  def nse_highlow(date_str):
241
  url="https://archives.nseindia.com/content/indices/" f"ind_close_all_{date_str}.csv"
242
+ csv_text= nse_csv_fetch(url )
243
+ return pd.read_csv(StringIO(csv_text), header=0)
244
 
245
  # ------------------------- STOCK 52-WEEK HIGH-LOW CSV -------------------------
246
  def stock_highlow(date_str):