def __getitem__(self, index):
        """Returns a single Band instance.

        This is a zero-based index which matches Python list behavior but
        differs from the GDAL one-based approach of handling multiband images.
        """
        if index < 0:
            index += len(self)
        index += 1
        band = self.ds.GetRasterBand(index)
        if not band:
            raise IndexError('No band for "%s"' % index)
        return band
def __getitem__ ( self , index ) : if index < 0 : index += len ( self ) index += 1 band = self . ds . GetRasterBand ( index ) if not band : raise IndexError ( 'No band for "%s"' % index ) return band
Returns a single Band instance.

        This is a zero-based index which matches Python list behavior but
        differs from the GDAL one-based approach of handling multiband images.