0

I have a numpy array size of MxN and a threshold value T. A formula is defined as a_ij = min(a_ij, T), for all a_ij in array A_(MxN)

It means that the threshold T will cut the value of the array A in low bound. Do we have any function in python to do it? I used np.min but it returned a number instead of an array

For example

A =[[1,2],[3,4]]
T=2
A_cut = min(A,T) = [[1,2],[2,2]]
2

1 Answer 1

3
np.minimum(A, T)
#array([[1,2], [2,2]])
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.