Create a module and array types numpy array 200 309

Installation Module

pip install numpy

Import module

import numpy as np

Creating an array

数组 = np.array(列表)
数组 = np.array(range(起始数,终止数)
数组 = np.arange(起始数,终止数)

Here Insert Picture Description

Class names array of objects

numpy.ndarray

Here Insert Picture Description

Type array members
Here Insert Picture Description

Type of array data

Here Insert Picture Description

Create an array of the specified type

数组 = np.array(列表, dtype=类型)

Here Insert Picture Description

Here Insert Picture Description

Modify the data type

新数组 = 数组.astype(类型)

Here Insert Picture Description

Mantissa choice decimal array

新数组 = np.round(原数组,保留位数)

Here Insert Picture Description

Published 64 original articles · won praise 1 · views 794

Guess you like

Origin blog.csdn.net/whalecode/article/details/104763327