Snippets

Du code concis, avec une explication claire.

python

matplotlib: fill_between, errorbar, twinx

Remplissages, barres d'erreur et axe secondaire.

#matplotlib#twinx
python

matplotlib: légende, grille, savefig

Gérer légendes, grille et exporter la figure.

#matplotlib#legend#savefig
python

matplotlib: courbe, nuage, histogramme

Tracer un line plot, un scatter et un histogramme simples.

#matplotlib#line#scatter
python

matplotlib: subplots grille

Créer une grille d'axes partagés.

#matplotlib#subplots#grid
python

matplotlib: subplots axes partagés

Créer des sous-graphiques partageant axes et limites.

#matplotlib#subplots#shared
python

numpy: création arrays (ones/zeros/arange)

Créer des arrays avec tailles/dtypes contrôlés.

#numpy#array#creation
python

numpy: boolean & fancy indexing

Sélectionner par masque booléen ou index entiers.

#numpy#indexing#mask
python

numpy: broadcasting basique

Opérations vectorisées avec élargissement automatique des dimensions.

#numpy#broadcasting#vectorize
python

numpy: règles de broadcasting

Appliquer des opérations sur formes compatibles sans copie.

#numpy#broadcast#shape
python

numpy: dtypes structurés

Créer des tableaux de records typés (structured arrays).

#numpy#dtype#structured
python

numpy: einsum et matmul batched

Exprimer des contractions et produits batched lisiblement.

#numpy#einsum#matmul
python

numpy: einsum vs dot

Utiliser einsum pour des contractions génériques.

#numpy#einsum#dot