Hi,

We (over at https://github.com/nipy/nibabel) often want to do stuff like this:

```
dtype_type = 'i'
size = 8
endianness = '<'
dtype = np.dtype('{}{}{}'.format(endianness, dtype_type, size))
```

I see that

"""
Use of the character codes, however, is discouraged.
"""

https://docs.scipy.org/doc/numpy-1.14.0/reference/arrays.scalars.html

What is the recommended way of specifying endianness in my dtype, if I
am not using the character codes?  Do I have to use something like:

```
np.dtype('int64').newbyteorder(endianness)
```

?

Cheers,

Matthew
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to