addPrefix#

geetools.ImageAccessor.addPrefix(prefix, bands=None)#

Add a prefix to the image selected band.

Add a prefix to the selected band. If no band is specified, the prefix is added to all bands.

Parameters:
  • prefix (str | ee.String) – The prefix to add to the band.

  • bands (list[str] | ee.List | None) – The bands to add the prefix to. If None, all bands are selected.

Returns:

The image with the prefix added to the selected bands.

Return type:

ee.Image

Examples

import ee, geetools

ee.Initialize()

image = ee.Image('COPERNICUS/S2_SR_HARMONIZED/20200101T100319_20200101T100321_T32TQM')
image = image.geetools.addPrefix('prefix_')
print(image.bandNames().getInfo())