Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

tweepy to dataframe

import os
import tweepy
import pandas as pd

# use os.environ.get to obtain other environment variables
# from ~/.bashrc or ~/.zshrc etc., so they aren't in your code
consumer_key = os.environ.get('c_key')
consumer_secret = # os...
access_token = # os...
access_token_secret = # os...
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)

results = api.search(q='cheese', count=100)

json_data = [r._json for r in results]

df = pd.json_normalize(json_data)
Comment

PREVIOUS NEXT
Code Example
Python :: calculate values in a certain percentile pandas 
Python :: three periods in python 
Python :: giving activation in dense layer keras 
Python :: python using recursion advanced 
Python :: python two list into dictinaray 
Python :: python using boolean len comparing with 
Python :: display calendar 
Python :: Using CGI with Python and HTML forms 
Python :: how to download a website using python 
Python :: india states django choices 
Python :: webhook logger python 
Python :: looping over folder to extract zip winrar python 
Python :: how to run ewa requirement.txt file 
Python :: setheading in python 
Python :: how to create a cubic function in python 3 
Python :: not staments python 
Python :: pandan jaya lrt 
Python :: vvm 2020 exam date 
Python :: python - from most_similar to ldictionary 
Python :: dashes in python packages 
Python :: iloc[ ] slicing 
Python :: how to save a count countvectorizer model in python 
Python :: Python sleep() in a multithreaded program 
Python :: kivy window location 
Python :: can you use pop on a string 
Python :: forward fill in pyspark 
Python :: ABA Alphabet pyramid 
Python :: kite order syntax 
Python :: convert matlab code to python 
Python :: how to choose appropriate graph for dataset visualization 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =