DearEIS CSV/xlsx data import error
- DearEIS version 4.2.1
- Python version- 3.10
- OS: Windows 11
I encounter this error when importing csv file:
[EIS 0 degree bend.xlsx] (https://github.com/user-attachments/files/16513729/EIS.0.degree.bend.xlsx)
Traceback (most recent call last): File "C:\Users\abhis\miniconda3\envs\deareis\lib\site-packages\pyimpspec\data_init_.py", line 158, in parse_data data = func(path, **kwargs) File "C:\Users\abhis\miniconda3\envs\deareis\lib\site-packages\pyimpspec\data\formats\csv.py", line 66, in parse_csv return dataframe_to_data_sets(df, path=path) File "C:\Users\abhis\miniconda3\envs\deareis\lib\site-packages\pyimpspec\data\data_set.py", line 816, in dataframe_to_data_sets data: DataSet = _dataframe_to_data_set( File "C:\Users\abhis\miniconda3\envs\deareis\lib\site-packages\pyimpspec\data\data_set.py", line 720, in _dataframe_to_data_set assert len(column_indices) >= 3, column_indices AssertionError: {'frequency': 0, 'imaginary': 2}
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\abhis\miniconda3\envs\deareis\lib\site-packages\deareis\program\data_sets.py", line 160, in load_data_set_files data_sets: List[pyimpspec.DataSet] = pyimpspec.parse_data(path) File "C:\Users\abhis\miniconda3\envs\deareis\lib\site-packages\pyimpspec\data_init_.py", line 160, in parse_data data = func(path, sep=None, decimal=",", **kwargs) File "C:\Users\abhis\miniconda3\envs\deareis\lib\site-packages\pyimpspec\data\formats\csv.py", line 66, in parse_csv return dataframe_to_data_sets(df, path=path) File "C:\Users\abhis\miniconda3\envs\deareis\lib\site-packages\pyimpspec\data\data_set.py", line 816, in dataframe_to_data_sets data: DataSet = _dataframe_to_data_set( File "C:\Users\abhis\miniconda3\envs\deareis\lib\site-packages\pyimpspec\data\data_set.py", line 720, in _dataframe_to_data_set assert len(column_indices) >= 3, column_indices AssertionError: {'imaginary': 2}
The exception above was encountered while parsing 'C:\Users\abhis\Downloads\EIS data\EIS 0 degree bend-2.csv'.
That is due to a bug in pyimpspec, which will be fixed in the upcoming 5.0.0 update. For now you can get around the bug by making sure that none of the column headers in your data files start with any whitespace by modifying, e.g., zre to zre (note the extra whitespace that was present before) prior to importing the files.
Version 5.0.0 of pyimpspec is now officially available, but it is not compatible with the currently available versions of DearEIS. However, I'm finishing up work on version 5.0.0 of DearEIS, which is compatible with the latest version of pyimpspec.
Version 5.0.0 is now available and this issue should now be resolved.