sukrutrao / Fast-Dawid-Skene

Code for the algorithms in the paper: Vaibhav B Sinha, Sukrut Rao, Vineeth N Balasubramanian. Fast Dawid-Skene: A Fast Vote Aggregation Scheme for Sentiment Classification. KDD WISDOM 2018
https://sites.google.com/view/fast-dawid-skene
MIT License
42 stars 11 forks source link

pandas Typeerror #4

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hi, I have cloned the repo and activated a conda environment based on the requirements file you provide. I use Python 2.7 and when I run python scripts/fast_dawid_skene.py --dataset toy --k 2 --mode aggregate --algorithm FDS --print_result I get this error: TypeError: argument of type 'int' is not iterable. This is the stack trace:

Traceback (most recent call last): File "scripts/fast_dawid_skene.py", line 64, in main() File "scripts/fast_dawid_skene.py", line 58, in main run(args) File "/home/konstantina/projects/Fast-Dawid-Skene/scripts/../fast_dawid_skene/main.py", line 41, in run result_annotations.reset_index(level=0, inplace=True) File "/home/konstantina/anaconda3/envs/dawid-skene/lib/python2.7/site-packages/pandas/core/frame.py", line 3055, in reset_index if level is None or i in level: TypeError: argument of type 'int' is not iterable

I changed level=0 to level={0} in main.py and there is no error anymore. Is this an appropriate solution?

sukrutrao commented 5 years ago

Hi, Could you please check which version of Pandas you are using? Perhaps this solution might help?

ghost commented 5 years ago

Thanks! I changed to 0.20.2 Pandas version and the code works as it is.

sukrutrao commented 5 years ago

Thank you for reporting this issue. The requirements file has now been updated.