You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if '|S1' was accepted as a synonym of 'char' when passing dtype to napi functions.
See attached patch to 4.2rc2 napi.py
Rationale:
Currently one can use numpy.dtype objects wherever a napi function requires dtype except for the case of string data.
This is because the numpy-->nexus data type conversion is done through
_nxtype_code[str(type)]
In the case of numpy 1-character arrays, str(dtype) returns '|S1', so at least this case can be covered pretty easily by using the proposed patch.
Note that this only works for numpy 1-character arrays, not for python strings. But at least one can convert to an array using:
numpy.array(tuple(string))
The text was updated successfully, but these errors were encountered:
Original reporter: Cpascual
It would be nice if '|S1' was accepted as a synonym of 'char' when passing dtype to napi functions.
See attached patch to 4.2rc2 napi.py
Rationale:
Currently one can use numpy.dtype objects wherever a napi function requires dtype except for the case of string data.
This is because the numpy-->nexus data type conversion is done through
In the case of numpy 1-character arrays, str(dtype) returns '|S1', so at least this case can be covered pretty easily by using the proposed patch.
Note that this only works for numpy 1-character arrays, not for python strings. But at least one can convert to an array using:
The text was updated successfully, but these errors were encountered: