lundi 25 octobre 2021

Is there any way I can add more condition to my if else loop?

I found a piece of code of code that looks like this:

data_set.label = [1 if i == 1 else -1 for i in  data_set.label.astype(int)].

In my case; for label, I have more than 2 value (7). How can I modify this code for my use?

Aucun commentaire:

Enregistrer un commentaire