2019-10-28

2019-10-28  本文已影响0人  元气小地瓜

Random模块 模块部分函数介绍

list列表

a=[1,2,3]

b=[[1,2,3],[1,2,3]]  

索引从0开始 a[0]=1    b[0,0]=1

c=[7,8,9]

list相加相当于字符串拼接      a+c-------->  [1,2,3,7,8,9]

a=[1,2,3]


list转化为ndarray结果

a=[1,2,3]

a=np.array(a)

type(a)     

注意type函数用法    type(xxxxxx)  

没有xxxx.type的用法

type函数判断变量类型为list还是ndarray


dtype

返回是int还是float

用法xx.dtype


numpy

ndarray所有元素必须同一类型

https://blog.csdn.net/weixin_38771509/article/details/98092076

https://blog.csdn.net/qq_24193303/article/details/80961646

https://blog.csdn.net/brucewong0516/article/details/79185282

https://blog.csdn.net/tymatlab/article/details/79009618

https://blog.csdn.net/Olaking/article/details/42463307

https://blog.csdn.net/qq_43483565/article/details/85010953

https://blog.csdn.net/yanggd1987/article/details/68921457

上一篇 下一篇

猜你喜欢

热点阅读