Python — From Basics to Advanced · NumPy — the foundation of numerical computing
Broadcasting — Operations Between Different Shapes
NumPy — the foundation of numerical computing
Introduction
Broadcasting lets you perform operations on arrays of different shapes without manually expanding them. The rules: compare shapes from the end — each dimension must be equal, or one of them must equal 1.