0

I have posted here part of the code. I want to get, say only the "Strike Price" information from nifty_opn but what I am getting here is that the strike_price information contains the date as well, something like this:

2014-12-01     2100

How to do it?

nifty_opn = get_history(symbol="NIFTY",
start=sdate,
end=sdate,
index=True,
option_type='CE',
strike_price=int(numpy.round(nifty_price.get('Close'),-2)),
expiry_date=expiry)   

symbol=nifty_opn.get('Symbol')
date=nifty_price.get('Date')
close=nifty_price.get('Close')
expiry=nifty_opn.get('Expiry')
strike_price=nifty_opn.get('Strike Price')
settle_price=nifty_opn.get('Settle Price')
contracts_no=nifty_opn.get('Number of Contracts')
data=[symbol,date,close,expiry,strike_price,settle_price,contracts_no]
  • One can do it in a different way, see the link here. https://stackoverflow.com/questions/14425133/date-object-with-year-and-month-only – Sweta Mahajan Jul 02 '18 at 15:55

1 Answers1

0

To remove axes label from dataframe use "values". Try below code:

nifty_opn['Strike Price'].values

This will returns the series as ndarray