Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import error when importing from .dta #20

Open
wotgit opened this issue Feb 19, 2024 · 0 comments
Open

import error when importing from .dta #20

wotgit opened this issue Feb 19, 2024 · 0 comments

Comments

@wotgit
Copy link

wotgit commented Feb 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant