I was a noob in python.Here I have a question about how to reshape the data into one hot encoder in python. The data where the number in userid are repeatable like this:
userid firstlogin
15605720 2017/4/20 0:00
24537631 2017/4/20 0:00
34012219 2017/4/20 0:00
……
32972232 2017/5/20 23:59
25698417 2017/5/20 23:59
31837935 2017/5/20 23:59
34092811 2017/5/20 23:59
I want to convert it into one hot encoder like this:
userid 2017/4/20 2017/4/21 ……
25181024 1 0
21631446 1 1
31784326 0 1
32258942 1 1
12840021 1 1
32709432 1 1
……
Above all, which function or method should I learn to deal with this problem. Thanks so much!