I am currently trying to use list comprehensions to filter some values on a data cube with some images, however I got lost to make the jump from 2 (as we can see in here or here) to 3 dimensions.
For a single image, the line of code that accomplishes what I want is:
AM2 = [[x if x > 1e-5 else 0 for x in line] for line in AM[0]]
How do I take this to also consider the different images that are stacked on the top of each other? I assume I would need to add a third nested loop but so far all my attempts to do so failed.
In my particular case the datacube is composed of numpy arrays having the dimensions of (100x400x900). Are lists comprehensions still advised to be used for filtering values over that volume of data?
Thanks for your time.