samedi 30 juillet 2016

working with NaN in a dataframe with if condition

I have 2 columns in a dataframe and I am trying to enter into a condition based on if the second one is NaN and First one has some values, unsuccessfully using:

if np.isfinite(train_bk['Product_Category_1']) and np.isnan(train_bk['Product_Category_2'])

and

   if not (train_bk['Product_Category_2']).isnull() and (train_bk['Product_Category_3']).isnull()

Aucun commentaire:

Enregistrer un commentaire