Python之Numpy
1.数组
array()
...import numpy as np ...a=np.array(range(12)) #array()创建数组 ...print(a) [0,1,2,3,4,5,6,7,8,9,10,11]
a.shape()
...a.shape #shape查看属性 (12,) #数组长度为12 ...a.shape=2,3 #改成2行3列二维结构 ...print(a) [[0,1,2,3,4,5] [6,7,8,9,10,11]] ...a.shape=2,2,3 #改成2组2行3列三维结构[[[0,1,2] [3,4,5]][[6,7,8] [9,10,11]]]
arange()
相关推荐
CodeAsWind 2020-08-17
sunnyhappy0 2020-07-09
cxcxrs 2020-06-26
深思千年 2020-06-10
xmwang0 2020-06-01
fgleeldq 2020-05-27
ShiShuo 2020-05-16
文山羊 2020-05-08
tengyuan 2020-05-07
Leewoxinyiran 2020-05-06
sschencn 2020-05-04
vevoly 2020-05-04
一只码畜 2020-04-22
sulindong0 2020-03-09
GoatSucker 2020-02-24
sdwylry 2020-02-14
mieleizhi0 2020-02-01