fork download
  1. import sklearn.preprocessing as preprocessing
  2.  
  3. x = [[7.8], [1.3], [4.5], [0.9]]
  4. print(preprocessing.Binarizer().fit(x).transform(x).shape)
Success #stdin #stdout 0.47s 69928KB
stdin
Standard input is empty
stdout
(4, 1)