Last active
September 27, 2018 14:39
-
-
Save emmagrimaldi/8403c0aa24d05977c0e8c8fdc31874be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # the range of the iteration starts from 2 because the first 2 | |
| # elements are not posts but instructions related to the page | |
| shower_thoughts_list = [shower_thoughts[i]['data']['title'] + ' ' + | |
| shower_thoughts[i]['data']['selftext'] | |
| for i in range(2,len(shower_thoughts))] | |
| # creating the dataframe from the list | |
| st_df = pd.DataFrame(shower_thoughts_list, columns=['post']) | |
| # adding the subreddit column | |
| st_df['subreddit'] = 'shower_thoughts' | |
| # checking | |
| st_df.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment