NumPy中ndarray类型属性、创建和变换

Recommend:

        First,I highly recommend 嵩天's classes which is pretty good for guys like us .

Yeah,I have learn a lot from that gentle and tender young man . So,come and learn

python with us .

https://www.icourse163.org/learn/BIT-1001870002?tid=1206192225#/learn/content?type=detail&id=1210784853&cid=1213173497&replay=true 

Click this you will enter into songtian's classes .

https://python123.io/index/open

A platform for practice .

Point:

ndarray的属性:
 .ndim
 .shape
 .size
 .dtype
 .itemsize

                        

                       

ndarray的创建:
    前提import numpy as np    
    np.array()
    np.arrange()
    np.ones(shape)
    np.zeros()
    np.full(shape,val)
    np.ones_like(a)
    np.zeros_like(a)
    np.full_like(a,val)

ndarray的变换:
    .reshape()
    .resize()
    .flatten()

    .astype()

See you next time , ciao !

 

发布了40 篇原创文章 · 获赞 24 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_41466575/article/details/92844810
今日推荐