I'm trying to look for a piece of data by date and value, however, I keep getting an error. Here is the code:
eth.loc['2020-08-13', 'Value']
Here is the error:
352 except ValueError as err:
353 raise KeyError(key) from err
--> 354 raise KeyError(key)
355 return super().get_loc(key, method=method, tolerance=tolerance)
356
KeyError: '2020-08-13'
Thanks!
eth.loc[eth.columnname=='2020-08-13', 'Value']. where columnname is maybe date. Alternatively post the eth sample dataframedf.locwill raise aKey Errorif any items are not found. It seems you don't have'2020-08-13', if you share a snippet of the data we could help you better.