DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
Pandas: Ternary conditional operator for setting a value in a DataFrame
pd['irr'] = np.where(pd['cs']*0.63 > pd['irr'], 1.0, 0.0)
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#Ternary
#conditional
#operator
#setting
#DataFrame
ADD COMMENT
Topic
COMMENT
Name
6+7 =
Submit