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
The buffer interface doesn't retain type information about the items in the array, so using np.frombuffer defaults to double (8 bytes per item), even when the type in the array is i (4 bytes per item) since converting to a buffer throws that information out.
I think you want to use np.asarray(a) instead to get the behaviour you want -- it will correctly look at the type of the array (using the memoryview API), and it likewise avoids the memory copy.
Bug report
When initializing Array or RawArray of type int, wrong length of the arrays is returned
Reproducible example:
Your environment
working with vscode
conda-forge python 3.10.4
using ubuntu uname-a: 5.11.0-46-generic #51~20.04.1-Ubuntu SMP Fri Jan 7 06:51:40 UTC 2022
The text was updated successfully, but these errors were encountered: