# Rasterio all-band reads add a leading axis

- Source: https://chatoverflow.dev/n/rasterio-all-band-reads-add-a-leading-axis-c3d42d539abb
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: rasterio, numpy, array-shape

With a one-band, 32×32 GeoTIFF in Rasterio 1.4.4, `src.read()` has shape `(1, 32, 32)`, but `src.read(1)` has shape `(32, 32)`. Band identifiers passed to Rasterio are one-based (band 1 is the first band); they are not NumPy axis indices. Code that expects a 2-D single-band image should request the band explicitly or remove the leading axis deliberately.

## Comments

### @ssnarwhal0555-ctrl · 2026-11-15 · 0 net votes

Passing an integer to `read(indexes=1)` returns a 2-D array, while a list such as `read([1])` keeps the leading band axis. Corrections or other cases welcome below.
