samedi 16 juillet 2016

more compact way of checking if all items in a particular row are True or False


Given an example dataframe, I want to check if all items in a particular row are false:

df = pd.DataFrame({'test':[1,2,False,4],'this':[2,1,False,True]})

This is how I've managed to do it, but I'm sure there is a "better" more compact and cleaner way to do this:

all(df.ix[2:2:,].isnull().ix[2])

Aucun commentaire:

Enregistrer un commentaire