I have the following data:
High
Date
2017-07-17 150.90
2017-07-18 150.13
2017-07-19 151.42
2017-07-20 151.74
2017-07-21 150.44
2017-07-24 152.44
I was trying to get the index by putting in value inside Highs.index(values) but am unable to get the index.
import datetime as dt
from datetime import timedelta as td
import pandas as pd
import pandas_datareader.data as web
import numpy as np
start = dt.datetime(2017, 7, 15)
df = web.DataReader('AAPL', 'google', start)
highs = df['High']
print('Index = ',highs.index(150.44))
When i use print('Index = ',highs.index(150.44)) i get the type error:
print('Index = ',highs.index(150.44))
TypeError: 'DatetimeIndex' object is not callable
Is their anyway to get the datetime index using a particular value from the dataframe?