Q:

Dataframe is not recognizing the column?

So I have a dataframe where I have different columns of prices of Reliance Stock. I can see that index of the dataframe is Date after I used df.index. However when I use df["Date"], it gives me an error saying 

AttributeError: 'DataFrame' object has no attribute 'Date'

data = nsepy.get_history(symbol = "RELIANCE",start = datetime.date(2018,1,1) , end = datetime.datetime.now().date())
data["Date"]

Why I am not able to select the first column of this dataframe?

A:

"Date" is the index of your dataframe and not a column.
Only the columns output by df.columns can be accessed using df[<col_name>].  
To check the index of your dataframe, just execute: df.index.  
Example:  
df = pd.DataFrame([{"A": 10, "B": 5}, {"A":20, "B": 4}, {"A": 14, "B": 200}])
df = df.set_index('A')
print(df.index)

the output is:
Int64Index([10, 20, 14], dtype='int64', name='A')

To set a particular column of your dataframe to index:
df = df.set_index(<col-name>)
To undo the above (convert current index to a column):
df.reset_index(inplace=True)

After resetting the index, you'll be able to access "Date" like a regular column, since it is no longer the index of your dataframe.

