标签:strong image ons reference 维数 bsp alias one dev
#一维数组转化成二维的方法: np.random.seed(101) arr=np.random.randint(1,4,size=6) print("\n原数组:\n",arr) print("\n如何把一维数组转换成二维的:") print("arr[:,None]:\n",arr[:,None]) print("") print("arr[:,np.newaxis]:\n",arr[:,np.newaxis])
以下是官方文档对None的说明:
另一个网址:
https://numpy.org/devdocs/reference/arrays.indexing.html
numpy.newaxis
A convenient alias(别名) for None, useful for indexing arrays.
numpy中一维数组增加维度,None,np.newaxis
标签:strong image ons reference 维数 bsp alias one dev
原文地址:https://www.cnblogs.com/bravesunforever/p/12668908.html