numbers
=
np
.
arange
(
1
,
5
)
example_array
=
np
.
array
(
numbers
)
example_array
[
[
x
%
2
==
0
for
x
in
example_array
]
]
#returns np.array([2,4])
Hosted on
Deepnote