Skip to content

Instantly share code, notes, and snippets.

@dipanjanS
Created September 22, 2019 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dipanjanS/b5a53423ac898463eaf2a7e74ee134bb to your computer and use it in GitHub Desktop.
Save dipanjanS/b5a53423ac898463eaf2a7e74ee134bb to your computer and use it in GitHub Desktop.
from sklearn.preprocessing import Binarizer
bn = Binarizer(threshold=0.9)
pd_watched = bn.transform([popsong_df['listen_count']])[0]
popsong_df['pd_watched'] = pd_watched
popsong_df.head(11)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment