kbknudsen / PyEIS

PyEIS: A Python-based Electrochemical Impedance Spectroscopy simulator and analyzer
Apache License 2.0
177 stars 61 forks source link

import error when importing from .dta #20

Open wotgit opened 9 months ago

wotgit commented 9 months ago

I get the following error message:

File "c:\Users\woutd\gamry_python\Model fitting\EIS_model_fitting.py", line 4, in ex1 = EIS_exp(path=datapath, data=['D6_D_Black_0_Points.DTA'], cycle=[1]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\woutd\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyEIS\PyEIS.py", line 2237, in init self.df_raw0.append(extract_dta(path=path, EIS_name=data[j])) #reads all datafiles ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\woutd\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyEIS\PyEIS_Data_extraction.py", line 122, in extract_dta data.update({'im': np.abs(data.im)}) ^^^^^^^^^^^^^^^ File "C:\Users\woutd\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\generic.py", line 2168, in array_ufunc__ return arraylike.array_ufunc(self, ufunc, method, *inputs, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\woutd\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\arraylike.py", line 276, in array_ufunc result = maybe_dispatch_ufunc_to_dunder_op(self, ufunc, method, inputs, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "ops_dispatch.pyx", line 105, in pandas._libs.ops_dispatch.maybe_dispatch_ufunc_to_dunder_op File "C:\Users\woutd\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\generic.py", line 1725, in abs__ return self.abs() ^^^^^^^^^^ File "C:\Users\woutd\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\generic.py", line 1718, in abs res_mgr = self._mgr.apply(np.abs) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\woutd\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\managers.py", line 362, in apply applied = b.apply(f, kwargs) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\woutd\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\blocks.py", line 393, in apply result = func(self.values, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: bad operand type for abs(): 'str'

Someone knows how to fix this problem? Thanks in advance. Kind regards.