Determine the endianness of a numpy array

后端 未结 1 802
无人共我
无人共我 2021-01-22 09:33

I have a numpy.array and I want to find out what endianness is used in the underlying representation.

A byteorder property is documented here,

相关标签:
1条回答
  • 2021-01-22 09:54

    byteorder is a data type objects dtype attribute so you need to do this:

    In [10]: import numpy as np
    
    In [11]: arr = np.array([1,2,3])
    
    In [12]: arr.dtype.byteorder
    Out[12]: '='
    
    0 讨论(0)
提交回复
热议问题