当前位置:网站首页>Numpy——1. Creation of array

Numpy——1. Creation of array

2022-07-05 07:35:00 Hair will grow again without it

Create array

np.array(object, dtype) or np.arange(start, stop, step, dtype)

object: The object of the created array , Can be a single value , list , Cell, etc .
example:
 Insert picture description here

dtype: data type

  1. Specify the data type
    example:
     Insert picture description here
     Insert picture description here 2. Adjust the data type
    a.astype("i1")
     Insert picture description here 3. Modify the number of floating-point numbers
    np.round(array, d)
     Insert picture description here
原网站

版权声明
本文为[Hair will grow again without it]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207050734185638.html