Sahaj.blogs

Day page

15 Feb 2024

Study

NumPy · Broadcasting

The broadcasting rules that let arrays of different shapes combine, and three uses: centring columns, outer products, and pairwise distances.

  • Shapes are compared from the right; two dimensions are compatible if they are equal or one of them is 1.
  • Broadcasting stretches arrays virtually; no data is actually copied.

Read the post →