python dataframe KeyError: ('TIMESTAMP_TZ', 'occurred at index TIMESTAMP_TZ') code example
Example: File "pandas/_libs/index.pyx", line 465, in pandas._libs.index.DatetimeEngine.get_loc KeyError: Timestamp('2019-01-02 07:09:00')
#check if DatetimeIndex
print (df_temp.index)
#if necessary convert column to index
df_temp.set_index('date',inplace=True)
#if necessary convert to datetimes
df_temp.index= pd.to_datetime(df_temp.index)
loc = df_temp.index.get_loc('2015-08-17')