I have the following data frame named target.
time_stamp | user_id | visited |
---|---|---|
2014-04-22 03:53:30 | 1 | 1 |
2013-11-15 03:45:04 | 2 | 1 |
2013-11-29 03:45:04 | 2 | 1 |
2013-12-09 03:45:04 | 2 | 1 |
2013-12-25 03:45:04 | 3 | 1 |
I would like to create a new data frame df, which has two columns user_id which are unique user_id numbers. and times which is a list of timestamps for when that user_id logged in.
I created another table to show the user id as a column and the corresponding timestamps in a list on another column but I can't publish the question because some sort of using code error keeps popping up.
iterating through the rows didn't work and I was also unsuccessful going through a for loop.
thanks