<s> import numpy as np <EOL> from osgeo import gdal <EOL> def stack_bands ( filenames ) : <EOL> """<STR_LIT>""" <EOL> bands = [ ] <EOL> for fn in filenames : <EOL> ds = gdal . Open ( fn ) <EOL> for i in range ( <NUM_LIT:1> , ds . RasterCount + <NUM_LIT:1> ) : <EOL> bands . append ( ds . GetRasterBand ( i ) . ReadAsArray ( ) ) <EOL> return np . dstack ( bands ) </s>
