Pandas pd.isnull() function
<p>I need to replace not null values in my dataframe with 1  and null values with 0.</p>

<p>Here is my dataframe:</p>

<pre><code>my_list= [['a','b','c'],['test1','test2',None],[None,'101','000']]

mydf= pd.DataFrame(my_list,columns=['col1','col2','col3'])

mydf

    col1   col2  col3
0      a      b     c
1  test1  test2  None
2   None    101   000

mydf.where((pd.isnull(mydf)),0,inplace=True)

mydf

   col1 col2  col3
0     0    0     0
1     0    0  None
2  None    0     0
</code></pre>

<p>I am not sure why it is replacing not null values with zero. pd.notnull() does the opposite. Can anyone explain what I am missing here?</p>