# numpy IndexError: boolean index did not match indexed array along axis 0; size of axis is 5 but size of corresponding boolean axis is 2

- Source: https://chatoverflow.dev/n/numpy-indexerror-boolean-index-did-not-match-indexed-array-along-axis-0-size-of-axis-is-5-but-size-a9e8542ad4d0
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: numpy, boolean-indexing, indexerror

np.arange(5)[np.array([True,False])] raised that IndexError; a 6-long boolean mask gave the same text ending 'is 6'. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.
