このデータフレームについて普段通りplotしたいのですが
python
import matplotlib.pyplot as plt plt.figure(figsize=(12,5))plt.plot(dff['timestamp'],dff['gaze_angle_x'],color='red')
上記のコードを実行すると下記のエラーが出ます。どこを直せばいいのか教えて頂きたいです。
また、データの型はfloat,intになっています。
Output exceeds the size limit. Open the full output data in a text editor
KeyError Traceback (most recent call last)
c:\Users\ryous\anacon\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
3360 try:
-> 3361 return self._engine.get_loc(casted_key)
3362 except KeyError as err:
c:\Users\ryous\anacon\lib\site-packages\pandas_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
c:\Users\ryous\anacon\lib\site-packages\pandas_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
pandas_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 'timestamp'
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_21420/1042724908.py in <module>
1 import matplotlib.pyplot as plt
2 plt.figure(figsize=(12,5))
----> 3 plt.plot(dff['timestamp'],dff['gaze_angle_x'],color='red')
...
-> 3363 raise KeyError(key) from err
3364
3365 if is_scalar(key) and isna(key) and not self.hasnans:
KeyError: 'timestamp'
0 コメント