Hi,
i have data as below:
-DATA-
tweetid, workerid
10115, user1
10115, user2
10190, user1
10190, user2
10193, user3
10320, user2
10320, user1
I have no idea, how i can write a code to transform this data to the 2D matrix.
My desire output is:
tweetid user1, user2, user3
10115 1, 1, 0
10190 1, 1, 0
10193 0, 0, 1
10320 1, 1, 0
Any help is much appreciated. Thank you.
i have data as below:
-DATA-
tweetid, workerid
10115, user1
10115, user2
10190, user1
10190, user2
10193, user3
10320, user2
10320, user1
I have no idea, how i can write a code to transform this data to the 2D matrix.
My desire output is:
tweetid user1, user2, user3
10115 1, 1, 0
10190 1, 1, 0
10193 0, 0, 1
10320 1, 1, 0
Any help is much appreciated. Thank you.