das ist der Kopf meiner Tabelle:
Code: Alles auswählen
Nr. Tag Datum Uhrzeit Mst10 RSumme
0 1 Mo 10.12.2018 11:35:00 209.0 NaN
1 2 Mo 10.12.2018 11:40:00 195.0 NaN
2 3 Mo 10.12.2018 11:45:00 449.0 NaN
3 4 Mo 10.12.2018 11:50:00 156.0 NaN
4 5 Mo 10.12.2018 11:55:00 407.0 NaN
5 6 Mo 10.12.2018 12:00:00 290.0 NaN
6 7 Mo 10.12.2018 12:05:00 446.0 NaN
7 8 Mo 10.12.2018 12:10:00 430.0 NaN
8 9 Mo 10.12.2018 12:15:00 349.0 NaN
9 10 Mo 10.12.2018 12:20:00 245.0 NaN
Code: Alles auswählen
<class 'pandas.core.frame.DataFrame'>
Index: 34254 entries, 0 to 34253
Data columns (total 6 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Nr. 34254 non-null object
1 Tag 34254 non-null object
2 Datum 34254 non-null object
3 Uhrzeit 34254 non-null object
4 Mst10 34254 non-null float64
5 RSumme 0 non-null float64
dtypes: float64(2), object(4)
memory usage: 1.8+ MB
None
Code: Alles auswählen
print(TabR.at[5, 'Mst10'])
Code: Alles auswählen
Traceback (most recent call last):
File "/home/kai/.local/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3080, in get_loc
return self._engine.get_loc(casted_key)
File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 4554, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 4562, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 5
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/kai/Dokumente/Python/Auswertung_Matplotlib.py", line 77, in <module>
print(TabR.at[5, 'Mst10'])
File "/home/kai/.local/lib/python3.8/site-packages/pandas/core/indexing.py", line 2156, in __getitem__
return super().__getitem__(key)
File "/home/kai/.local/lib/python3.8/site-packages/pandas/core/indexing.py", line 2103, in __getitem__
return self.obj._get_value(*key, takeable=self._takeable)
File "/home/kai/.local/lib/python3.8/site-packages/pandas/core/frame.py", line 3144, in _get_value
index = self.index.get_loc(index)
File "/home/kai/.local/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3082, in get_loc
raise KeyError(key) from err
KeyError: 5
Gruß Kai