I'm working with Sentinel images and want to sample the pixels of raster file only in the places which are represented by the geometry of the truth data which I have it in the form of shapefile. All I want to find is the analogous of the below code in Python.
var training = image.select(bands).sampleRegions({
collection: points,
properties: [class],
scale: 30
});
image.select(bands) - is my raster data,
Collection- is my shapefile