You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
import arff
for row in arff.load('example.arff'):
print row[-1]
Where this is the example file:
@relation diabetics_data
@attribute hair_color {blonde, black, blue}
@attribute age real
@attribute patno integer
@data
blonde, 17.2, 1
blue, 27.2, 2
blue, 18.2, 3
What is the expected output? What do you see instead?
Should print:
1
2
3
But this is happening:
Traceback (most recent call last):
File "test.py", line 3, in <module>
y = row[-1]
File "/usr/local/lib/python2.7/dist-packages/arff/__init__.py", line 105, in __getitem__
return self._data[key]
KeyError: -1
What version of the product are you using? On what operating system?
arff librry version 0.9
python 2.7
ubuntu 12.04
Original issue reported on code.google.com by [email protected] on 20 Sep 2012 at 5:32
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 20 Sep 2012 at 5:32The text was updated successfully, but these errors were encountered: