addPrefix#

geetools.ee_image.ImageAccessor.addPrefix(prefix, bands=[])#

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 | ee.List) – The bands to add the prefix to. If None, all bands are selected.

Returns:

The image with the prefix added to the selected bands.

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())