Multiplication matricielle NumPy : démarrez en 5 minutes (2024)

Dans le code ci-dessus, nous avons la matrice A[[6, 7], [8, 9]]. Nous demandons l'élément donné à(0,0), et notre sortie renvoie6. Lorsque nous voulons définir la forme de notre matrice, nous utilisons le nombre de lignes par le nombre de colonnes. Cela signifie que la matrice A a une forme de 2x2.

​Maintenant, examinons quelques différentes méthodes de multiplication matricielle NumPy.

Méthodes de multiplication matricielle NumPy

Il y atrois manières principalespour effectuer une multiplication matricielle NumPy :

  • np.dot (tableau a, tableau b): renvoie le produit scalaire ou scalaire de deux tableaux
  • np.matmul (tableau a, tableau b): renvoie le produit matriciel de deux tableaux
  • np.multiply (tableau a, tableau b): renvoie la multiplication matricielle élément par élément de deux tableaux

Examinons de plus près chacune des trois méthodes avec un didacticiel NumPy de chacune :

Multiplication matricielle NumPy : démarrez en 5 minutes (2024)

References

Top Articles
Latest Posts
Article information

Author: Corie Satterfield

Last Updated:

Views: 6066

Rating: 4.1 / 5 (42 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Corie Satterfield

Birthday: 1992-08-19

Address: 850 Benjamin Bridge, Dickinsonchester, CO 68572-0542

Phone: +26813599986666

Job: Sales Manager

Hobby: Table tennis, Soapmaking, Flower arranging, amateur radio, Rock climbing, scrapbook, Horseback riding

Introduction: My name is Corie Satterfield, I am a fancy, perfect, spotless, quaint, fantastic, funny, lucky person who loves writing and wants to share my knowledge and understanding with you.