gpt4 book ai didi

python - 确定 numpy 数组的字节顺序

转载 作者:太空宇宙 更新时间:2023-11-03 15:04:51 24 4
gpt4 key购买 nike

我有一个 numpy.array,我想找出底层表示中使用的字节顺序。

byteorder 属性已记录 here , 但没有一个给定的示例显示它与数组一起使用。

最佳答案

byteorder 是一个数据类型对象 dtype属性,所以你需要这样做:

In [10]: import numpy as np

In [11]: arr = np.array([1,2,3])

In [12]: arr.dtype.byteorder
Out[12]: '='

关于python - 确定 numpy 数组的字节顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34097845/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com