我是靠谱客的博主 无心帽子,这篇文章主要介绍python int32 int8_用numpy vi将int32转换为int8,现在分享给大家,希望可以做个参考。

Is this related to how the number is stored in memory?Endianness refers to the sequential order in which bytes are arranged into larger numerical values, when stored in computer memory or secondary storage, or when transmitted over digital links. Endianness is of interest in computer science because two conflicting and incompatible formats are in common use: words may be represented in big-endian or little-endian format, depending on whether bits or bytes or other components are ordered from the big end (most significant bit) or the little end (least significant bit).>>> import numpy as np

>>> a = np.array([1, 2, 3, 4], dtype='>i4')

>>> a.view('int8')

array([0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4], dtype=int8)

>>> a = np.array([1, 2, 3, 4], dtype='

>>> a.view('int8')

array([1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0], dtype=int8)

如果没有,它将使用系统的endianness。使用另一个可能会导致(轻微)性能下降。在

最后

以上就是无心帽子最近收集整理的关于python int32 int8_用numpy vi将int32转换为int8的全部内容,更多相关python内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(76)

评论列表共有 0 条评论

立即
投稿
返回
顶部