∇λ∫∑
LabsPython / NumPy · How axes stretch
Broadcasting shapes
Pick two ndarray shapes and see whether NumPy can align them — and what the result looks like.
Align shapes on the right. A 1 stretches; a missing leading axis is a 1. Two disagreeing non-1 axes refuse. That is the whole rule.
Ask the studio
Broadcasting shapes
This chat can see the instrument. Questions here are about this picture.
Exclusive to this lab — pick one, or type your own about the controls.