Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas columns case when equivalent

df['c'] = np.select(
[
    (df['a'].isnull() & (df['b'] == 0))
], 
[
    1
], 
default=0 )
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #columns #case #equivalent
ADD COMMENT
Topic
Name
7+5 =