I have searched the whole of Stack Overflow and yet to see a solution to this.
Is there a way to check whether a variable/string is NAType?
Column:
DBRef('sector', 29)
DBRef('sector', 29)
DBRef('sector', 29)
DBRef('sector', 29)
DBRef('sector', 29)
DBRef('sector', 29)
<NA>
Loop:
for q in list:
b = q.split("'")[2]
newcol.append(b)
Error:
AttributeError: 'NAType' object has no attribute 'split'
Expected:
, 29)
, 29)
, 29)
, 29)
, 29)
, 29)
<NA>
I want to split everything that is not <NA>
, if it is then it should do nothing.