Answers for "File "pandas/_libs/index.pyx", line 465, in pandas._libs.index.DatetimeEngine.get_loc KeyError: Timestamp('2019-01-02 07:09:00')"

0

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')
Posted by: Guest on April-12-2020

Code answers related to "File "pandas/_libs/index.pyx", line 465, in pandas._libs.index.DatetimeEngine.get_loc KeyError: Timestamp('2019-01-02 07:09:00')"

Python Answers by Framework

Browse Popular Code Answers by Language