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

np.stack error on complex numpy array #6

Closed
damienjacquet opened this issue Sep 12, 2022 · 1 comment
Closed

np.stack error on complex numpy array #6

damienjacquet opened this issue Sep 12, 2022 · 1 comment
Assignees
Labels

Comments

@damienjacquet
Copy link

to encode complex array, the np.stack method is used, but it results in the following error :

File "C:\XXX\Lib\site-packages\jdata\jdata.py", line 136, in encode
newobj["_ArrayData_"] = np.stack(d.ravel().real, d.ravel().imag)
TypeError: only integer scalar arrays can be converted to a scalar index

imaginary part is seen as the "axis" parameter of np.stack function. adding 2 parenthesis should fix the bug
newobj["_ArrayData_"] = np.stack((d.ravel().real, d.ravel().imag))

@fangq fangq self-assigned this Sep 12, 2022
@fangq fangq added the bug label Sep 12, 2022
@fangq
Copy link
Member

fangq commented Sep 14, 2022

fixed in NeuroJSON/pyjdata#3

@fangq fangq closed this as completed Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants