Answer the question
In order to leave comments, you need to log in
How to check array elements for some condition?
There is a random array:
Using this array, you need to transform it into a new array with the following values:
а = np.random.randint(15, 37, (2, 3, 4))
[
[
Answer the question
In order to leave comments, you need to log in
a = np.random.randint(15, 37, (2, 3, 4))
print(a)
[
]
b = np.full_like(a.astype(str), 'medium')
b[a < 20] = 'small'
b[a > 30] = 'large'
print(b)
[
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question