In one of my pandas column, I have stored lists.
For example, [url.com, url2.com, url3.com]
Here is a sample printout of the column:
associated_Urls
322 [http://www.hotfrog.ie/business/golf-gifts-ire...
466 [http://en.netlog.com/A_ni_nha]
433 [https://www.moog.com.cn/literature/ICD/Moog_G...
13 [http://www.schooldays.ie/thread/Childminder-w...
438 [http://tracking.instantcheckmate.com/?a=60&c=...
308 [http://www.wayn.com/profiles/abc123, https://...
361 [https://whoswholegal.com/profiles/abcdef........
In an apply
function I check if each of these rows are null, using:
def myfunc(row):
if pd.notnull(row['associated_Urls']):
#do something
df.apply(myfunc,axis=1)
However I get the following error:
if pd.notnull(row['associated_Urls']):
ValueError: ('The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()', 'occurred at index 322')
I checked the row at index 322, and it is not null. There is a list with urls inside the list.
What is the best way to check if this particular cell is null?
According to this question it was fixed: Weird null checking behaviour by pd.notnull
But yet I get the error. Any advice is appreciated.