Tableaux/listes en Python (2/2) www.mp933.fr Matrices, et sombres histoires de pointeurs

Tableaux/listes en
Python (2/2)
Stéphane Gonnord
Plan
Tableaux et listes en
Python
Tableaux
bidimensionnels
Un peu de
numpy.array
Tableaux/listes en Python (2/2)
Matrices, et sombres histoires de pointeurs
Stéphane Gonnord
www.mp933.fr
Lycée du parc - Lyon
Vendredi 7 février 2014
Tableaux/listes en
Python (2/2)
Stéphane Gonnord
Plan
Tableaux et listes en
Python
Tableaux
bidimensionnels
Un peu de
numpy.array
Plan
1. Quelques rappels :
ICréation, indexation
ISlicing
ICopie
IPassage en paramètre
IParcours
2. Tableaux bidimensionnels :
ICréation basique, indexation
ICréation-bis : le drame
IRecopie
3. Un peu de numpy
ILes tableaux array
IMatrices
ISlicing multidimensionnel.
Tableaux/listes en
Python (2/2)
Stéphane Gonnord
Plan
Tableaux et listes en
Python
Tableaux
bidimensionnels
Un peu de
numpy.array
Plan
1. Quelques rappels :
ICréation, indexation
ISlicing
ICopie
IPassage en paramètre
IParcours
2. Tableaux bidimensionnels :
ICréation basique, indexation
ICréation-bis : le drame
IRecopie
3. Un peu de numpy
ILes tableaux array
IMatrices
ISlicing multidimensionnel.
Tableaux/listes en
Python (2/2)
Stéphane Gonnord
Plan
Tableaux et listes en
Python
Tableaux
bidimensionnels
Un peu de
numpy.array
Plan
1. Quelques rappels :
ICréation, indexation
ISlicing
ICopie
IPassage en paramètre
IParcours
2. Tableaux bidimensionnels :
ICréation basique, indexation
ICréation-bis : le drame
IRecopie
3. Un peu de numpy
ILes tableaux array
IMatrices
ISlicing multidimensionnel.
Tableaux/listes en
Python (2/2)
Stéphane Gonnord
Plan
Tableaux et listes en
Python
Tableaux
bidimensionnels
Un peu de
numpy.array
Création, indexation
IBasique :
>>> t = [10, 12, 15, 7]
>>> len(t)
4
>>> t[2]
15
>>> t[4]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: list index out of range
>>> t[-1]
7
IMais aussi :
>>> [0] * 5
[0, 0, 0, 0, 0]
>>> [1 for i in range(3)]
[1, 1, 1]
>>> [i**2 for i in range(3)]
[0, 1, 4]
>>> [2 for _ in range(3)]
[2, 2, 2]
1 / 55 100%

Tableaux/listes en Python (2/2) www.mp933.fr Matrices, et sombres histoires de pointeurs

La catégorie de ce document est-elle correcte?
Merci pour votre participation!

Faire une suggestion

Avez-vous trouvé des erreurs dans linterface ou les textes ? Ou savez-vous comment améliorer linterface utilisateur de StudyLib ? Nhésitez pas à envoyer vos suggestions. Cest très important pour nous !