参考書で機械学習を学んでたのですが、このようなエラーがでます。
わかるかたがいましたら、教えてください
python
1import matplotlib.pyplot as plt 2import pandas as pd 3 4#ファイルを読む 5df = pd.read_csv('kion10y.csv', encoding = "utf-8") 6 7#気温が30度越えのデータを調べる 8atui_bool = (df["気温"]) 9 10#データを抜き出す 11atui = df[atui_bool] 12 13#年ごとにカウント 14cnt = atui.groupby(["年"])["年"].count() 15 16#出力 17print(cnt) 18cnt.plot() 19plt.savefig("tenki-over30.png") 20plt.show()
--------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-11-cf8066fa4acc> in <module> 9 10 #データを抜き出す ---> 11 atui = df[atui_bool] 12 13 #年ごとにカウント ~/anaconda3/lib/python3.7/site-packages/pandas/core/frame.py in __getitem__(self, key) 2680 if isinstance(key, (Series, np.ndarray, Index, list)): 2681 # either boolean or fancy integer index -> 2682 return self._getitem_array(key) 2683 elif isinstance(key, DataFrame): 2684 return self._getitem_frame(key) ~/anaconda3/lib/python3.7/site-packages/pandas/core/frame.py in _getitem_array(self, key) 2724 return self._take(indexer, axis=0) 2725 else: -> 2726 indexer = self.loc._convert_to_indexer(key, axis=1) 2727 return self._take(indexer, axis=1) 2728 ~/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py in _convert_to_indexer(self, obj, axis, is_setter) 1325 if mask.any(): 1326 raise KeyError('{mask} not in index' -> 1327 .format(mask=objarr[mask])) 1328 1329 return com._values_from_object(indexer) KeyError: '[3.6 3.8 4.4 ... 5.2 5.5 6. ] not in index'
質問のタイトルにわかりやすい内容を書いてください
具体的にどの部分がわからないのか質問したいことを書いてください。