You can use if...else if your list is small.
The following two approaches look more Pythonic. You can try one of them.
Approach 1
>>> pred_probs = [0.12,0.34,0.54,0.98,0.67,0.21,0.43,0.47,0.78,0.90]>>> labels = [int(p>=0.6) for p in pred_probs]>>> labels[0, 0, 0, 1, 1, 0, 0, 0, 1, 1]
Approach 2
>>> import numpy as np>>> labels=np.array(pred_probs)>>> labelsarray([0.12, 0.34, 0.54, 0.98, 0.67, 0.21, 0.43, 0.47, 0.78, 0.9 ])>>> labels[labels>=0.6]=1>>> labels[labels<0.6]=0>>> labelsarray([0., 0., 0., 1., 1., 0., 0., 0., 1., 1.])