Binarize data deep learning

How can i binarize data in such a way that 62.74% data with low values be labelled as 1 whereas rest 37.26% data with higher values be labelled as 0.

(In MP NEURON)

Hi

You can do something ike this

import numpy as np

percent_cut=np.percentile(array,62.74)

data[‘column_bin’]=data[‘column’].map(lambda x: 1 if x<percent_cut else 1)_

if you need to apply to all columns,I think there is no escape from looping it through as 62.74 percetile differes for each columns

That’s great thanks a lot