How to turn a Pandas DataFrame into a table of vectors

I have a two columns Pandas data frame containing a list of user_ids and some URLs they have visited. It looks like this: users urls 0 user1 url1 1 user1 url3 2 user1 url5 3 user2 …