Skip to content
Discussion options

You must be logged in to vote

passing a callable is roughly equivalent to

f = lambda x: x < 0.92
ndvi_stack.where(f(ndvi_stack), 0.92)

This allows code like this to work:

ndvi_stack.where(lambda x: x <0.92, 0.92).where(lambda x: x > -0.08)

In the example you gave there's not really a good reason to use a callable since you're not chaining method calls or renaming variables.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ste-goldstein
Comment options

@keewis
Comment options

Answer selected by ste-goldstein
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants