eshan6704 commited on
Commit
558241c
·
verified ·
1 Parent(s): 8e9338e

Update nsepython.py

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