I am trying to filter a MODIS image collection for two date ranges with the Python API of Google Earth Engine, but I'm encountering the following problem.
In the JavaScript Google Code Editor, I would do something like this:
var modis1 = ee.ImageCollection('MODIS/006/MOD11A1');
var rng1= ee.Filter.date('2019-02-01','2019-06-30');
var rng2 = ee.Filter.date('2020-02-01','2020-06-30');
var rngor = ee.Filter.or(rng1,rng2);
var modisfiltered = modis1.filter(rngor);
And this would work. In Python, instead, the code stops on the ee.Filter.or
line because of an "Invalid Syntax"
error.
Is it because or
is a reserved keyword in Python?
How can I obtain the same result?