User Tools

Site Tools


appunti3s:numpy

This is an old revision of the document!


indice < linguaggio_python

numpy

https://numpy.org/doc/stable/

Il python classico usa gli oggetti unidimensionali array.array

numpy permette di usare un nuovo tipo di array

 numpy.array 

noti anche con il termine “ndarray”

Vediamo alcuni esempi per definire un array

import numpy as np
a = [[ 1., 0., 0.], [ 0., 1., 2.]]
b = np.array([1.2, 3.5, 5.1])
c = np.array( [ [1.0,2.0], [3.0,4.0] ], dtype=complex )
d = np.zeros((3, 4))
e = np.ones((3, 4))
appunti3s/numpy.1594245268.txt.gz · Last modified: 2020/07/08 23:54 by profpro