Python Forum
isnull() in pandas not able to identify blank value (Python coding) - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: isnull() in pandas not able to identify blank value (Python coding) (/thread-25124.html)



isnull() in pandas not able to identify blank value (Python coding) - darpInd - Mar-20-2020

import pandas as pd
t1=pd.DataFrame()
t1 ['name'] = ["dp","ag","wp"]
t1['status'] = ['a','b','c']
t1['age'] = [10,"",15]
t1
##
print(t1.isnull().values)
Why is the execution of this node not able to identify blank (see "age" column, 2nd row). isnull() is coming false for all the cells, see below output Output:
Output:
[[False False False] [False False False] [False False False]]



RE: isnull() in pandas not able to identify blank value (Python coding) - scidam - Mar-20-2020

I didn't see in the official docs that .isnull should handle such cases.
if you want to catch empty strings, just do df == "".