1

Running this with nsepy 0.4 and Python 2.7 returns an empty dataframe. This was working until last week.

from nsepy import get_history as gh
from datetime import date

stk1 = gh(symbol='SBIN',start=date(2015,1,1),end=date(2015,1,10))
print(stk1)

Output:

Empty DataFrame

Columns: [Symbol, Series, Prev Close, Open, High, Low, Last, Close, VWAP, Volume, Turnover, Trades, Deliverable Volume, %Deliverble]

Index: []

Whereas, this works:

stk1 = gh(symbol='NIFTY',start=date(2015,1,1),end=date(2015,1,10), index=True)
print(stk1)

Output:

Date        Open     High      Low    Close     Volume      Turnover

2015-01-01  8272.80  8294.70  8248.75  8284.00   56560411  2.321880e+10

2015-01-02  8288.70  8410.60  8288.70  8395.45  101887024  4.715720e+10

2015-01-05  8407.95  8445.60  8363.90  8378.40  118160545  5.525520e+10

2015-01-06  8325.30  8327.85  8111.35  8127.35  172799618  8.089190e+10

2015-01-07  8118.65  8151.20  8065.45  8102.10  164075424  7.464330e+10

2015-01-08  8191.40  8243.50  8167.30  8234.60  143802802  8.147400e+10

2015-01-09  8285.45  8303.30  8190.80  8284.50  152612528  9.305950e+10

What am I doing wrong?

Abbas
  • 3,872
  • 6
  • 36
  • 63
Thewalker
  • 11
  • 1
  • 3

2 Answers2

1

NSE's website has been updated making nsepy 0.4 incompatible, hence it will not work now. please uninstall nsepy and and run pip install nsepy again to install version 0.5 which has fix for this.

swapnil jariwala
  • 1,064
  • 2
  • 12
  • 19
0

This is not working for me as well, but futures data is working.

I think NSE has done some update on their server.

I am using nsepy package version 0.7 as checked by the following code

import nsepy
print(nsepy.__VERSION__)
N V
  • 83
  • 2
  • 12
  • If you did not find an answer from this post, please ask a new question. Provide enough details to not be marked as a duplicate and also reference this post, be sure to explain how your problem is different. – Cray Jun 24 '19 at 20:05