DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python replace negative values with 0
In [5]: df.mask(df < 0, 0) Out[5]: a b 0 0 0 1 0 2 2 2 1
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#python
#replace
#negative
#values
ADD COMMENT
Topic
COMMENT
Name
4+6 =
Submit