D
D
Denis Lvov2020-01-15 17:14:41
numpy
Denis Lvov, 2020-01-15 17:14:41

How to filter an array with multiple conditions using numpy?

jj = np.array()

is it possible to filter by several conditions?
well, for example:
jj[:, 0]>2 & jj[:, 2]>5
and get the output:
[3, 4, 9]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Lvov, 2020-01-15
@dwenlvov

jj1 = jj[jj[:, 0] > 2]
jj1[jj1[:, 2] > 5]

you can do it like this, for example.
But there is no more ... for a nice option or something

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question