PythonQ 240-8XX Manuel d'utilisateur Page 9

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 37
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 8
c
! www.simula.no/˜hpl
Array with a sequence of numbers
linspace(a, b, n) generates n uniformly spaced coordinates,
starting with a and ending with b
>>> x = linspace(-5, 5, 11)
>>> print x
[-5. -4. -3. -2. -1. 0. 1. 2. 3. 4. 5.]
Aspecialcompactsyntaxisalsoavailable:
>>> a = r_[-5:5:11j] # same as linspace(-5, 5, 11)
>>> print a
[-5. -4. -3. -2. -1. 0. 1. 2. 3. 4. 5.]
arange works like range (xrange)
>>> x = arange(-5, 5, 1, float)
>>> print x # upper limit 5 is not included!!
[-5. -4. -3. -2. -1. 0. 1. 2. 3. 4.]
Numerical Python – p. 243/728
Vue de la page 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... 36 37

Commentaires sur ces manuels

Pas de commentaire