Before running pd.cut()
my array has values of 0.0 -0.25 0.25 0.50 ... etc
after running pd.cut()
my array has NaN NaN ... etc
I know the problem has to do with how I setup my bins.
I have tried both of the code segments below:
bins = (2, 0.0 , 100)
group_names = ['Bad', 'Good']
array['Values'] = pd.cut(array['Values'], bins=bins, labels=group_names)
bins = (2, 5.0, 100)
group_names = ['Bad', 'Good']
array['Values'] = pd.cut(array['Values'], bins=bins, labels=group_names)
I am expecting the array values to be replaced with Good and Bad. If the array value is greater then 0.0 then Good else Bad
Example:
0.0 -0.25 0.25 0.50
Bad Bad Good Bad