intersection#

geetools.ee_list.ListAccessor.intersection(other)#

Compute the intersection of the current list and the other list.

The intersection is the list of elements that are in both lists.

Parameters:

other (list | ee.List) – The list to compute the intersection with.

Returns:

A list of strings corresponding to the intersection of the current list and the other list.

Return type:

ee.List

Examples

import ee, geetools
from geetools.utils import initialize_documentation

initialize_documentation()

l1 = ee.List(["1", "2", "3"])
l2 = ee.List(["2", "3", "4"])

l1.geetools.intersection(l2).getInfo()
['2', '3']