I have a list that contains dates that I created using:
dates_list = pd.date_range(startdate, num_of_periods, freq = 'MS')
^stored the date range in dates_list
This returns my monthly list of dates correctly if I do print(dates_list).
What I am trying to do is looking for an index number given a specific date in the range. I tried:
dates_list.index(call_date)
^^where call_date is the date I am trying to find the index number of
and I get an error message that reads:
TypeError: 'DatetimeIndex' object is not callable
If I try this same command on a simpler list,
ie: simple_list = ['cheese', 'banana', 'mushroom', 'apple' ...]
simple_list.index('banana') it returns 1.
How do I get the index value from a list of dates? Is there something I have to do differently?
Any feedback would be appreciated. Thank you.