I have been wondering how to vectorize the function below for my dataframe. And can anything be vectorized?
Here is my dataframe:
date AGE
0 28/04/2017 13:08 25
1 28/04/2017 08:58 87
2 03/05/2017 07:59 23
3 03/05/2017 08:05 45
4 04/05/2017 08:05 26
5 05/05/2017 08:05 10
6 06/05/2017 08:05 56
7 07/05/2017 08:05 39
Here is the function I want to use for vectorisation:
def decision(value):
if value>40:
return 1
return 0
I do not want to use np.where, or any lambda expression.