Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
python numpy array boolean indexing
Rabi
Programming language:
Python
2021-07-06 14:55:37
0
Q:
python numpy array boolean indexing
Andrew Troup
Code:
Python
2021-07-13 18:56:29
x = np.array([1., -1., -2., 3]) x[x < 0] = 20 x Output: array([ 1., 20., 20., 3.])
0
Tags
python
array
index
Related
to convert to boolean in python
python boolean
set boolean to opposite python
python boolean operators
convert string to boolean python
boolean python meaning for idiots
if boolean python
boolean python example
numpy boolean array
Python Booleans
apply boolean to list
Python declare an empty array
python subset pandas dataframe based on list of booleans
New to Communities?
Join the community