MITMediaLabAffectiveComputing/eda-explorer

Error loading sample_Q.csv

luke777 opened this issue · 1 comments

I'm try to run EDA-Artifact-Detection-Script.py with the Anaconda distribution of python 2.7.15

I get the following error.

PS D:\dev\eda-explorer-master> python .\EDA-Artifact-Detection-Script.py
Pickle Directory (type ./ for current directory): ./
Loading SVM file from ./classify.py
Would you like 1 classifier (Binary or Multiclass) or both (enter 1 or 2): 1
Name of classifier (Binary or Multiclass): Binary
Data Type (e4 or q or misc): q
Filepath: sample_Q.csv
Classifying data for sample_Q.csv
Traceback (most recent call last):
 File ".\EDA-Artifact-Detection-Script.py", line 357, in <module>
   labels,data = classify(filepath,classifierList,pickleDirectory,loadData_Qsensor)
 File ".\EDA-Artifact-Detection-Script.py", line 227, in classify
   data = loadDataFunction(filepath)
 File "D:\dev\eda-explorer-master\load_files.py", line 69, in loadData_Qsensor
   data.columns = ['AccelZ','AccelY','AccelX','Battery','Temp','EDA']
 File "C:\ProgramData\Anaconda2\lib\site-packages\pandas\core\generic.py", line 4389, in __setattr__
   return object.__setattr__(self, name, value)
 File "pandas\_libs\properties.pyx", line 69, in pandas._libs.properties.AxisProperty.__set__
 File "C:\ProgramData\Anaconda2\lib\site-packages\pandas\core\generic.py", line 646, in _set_axis
   self._data.set_axis(axis, labels)
 File "C:\ProgramData\Anaconda2\lib\site-packages\pandas\core\internals.py", line 3323, in set_axis
   'values have {new} elements'.format(old=old_len, new=new_len))
ValueError: Length mismatch: Expected axis has 7 elements, new values have 6 elements

It seems the problem can be fixed by making the following change to load_files.py
Moving data = data.reset_index() to after
data.columns = ['AccelZ','AccelY','AccelX','Battery','Temp','EDA']

This might have been an issue with using a different version of pandas. In any case, the scripts have been updated! Please take a look to see if the update fixed your problem.