我是靠谱客的博主 无心帽子,最近开发中收集的这篇文章主要介绍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 int32 int8_用numpy vi将int32转换为int8所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部