PythonQ 240-8XX Instrukcja Użytkownika Strona 9

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 37
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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
Przeglądanie stron 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... 36 37

Komentarze do niniejszej Instrukcji

Brak uwag