Créez un module et les types de tableaux tableau de numpy 200 309

Installation Module

pip install numpy

module import

import numpy as np

Création d'un tableau

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

Insérer ici l'image Description

Les noms de classe tableau d'objets

numpy.ndarray

Insérer ici l'image Description

Type membres du groupe
Insérer ici l'image Description

Type de données de tableau

Insérer ici l'image Description

Créer un tableau du type spécifié

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

Insérer ici l'image Description

Insérer ici l'image Description

Modifier le type de données

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

Insérer ici l'image Description

Mantisse choix tableau décimal

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

Insérer ici l'image Description

Publié 64 articles originaux · louange gagné 1 · vues 794

Je suppose que tu aimes

Origine blog.csdn.net/whalecode/article/details/104763327
conseillé
Classement