convert single index pandas data frame to multi-index
I have a data frame with following structure:
df.columns
Index(['first_post_date', 'followers_count', 'friends_count',
'last_post_date','min_retweet', 'retweet_count', 'screen_name',
'tweet_count', 'tweet_with_max_retweet', 'tweets', 'uid'],
dtype='object')
Inside the tweets series, each cell is another data frame containing all the tweets of an user.
df.tweets[0].columns
Index(['created_at', 'id', 'retweet_count', 'text'], dtype='object')
I want to convert this data frame to a multi-index frame, essentially by breaking the cell containing tweets. One index will be the uid, and another will be the id inside tweet.
How can I do that?
Category Data Science