Skip to content

Instantly share code, notes, and snippets.

@Nick3523
Last active July 23, 2020 15:08
Show Gist options
  • Save Nick3523/7e5bca83df602ef357e36004c463f623 to your computer and use it in GitHub Desktop.
Save Nick3523/7e5bca83df602ef357e36004c463f623 to your computer and use it in GitHub Desktop.
from dataprep.data_connector import *
from dataprep.eda import *
# À obtenir via un compte twitter pour developpeur
client_id = '****************'
client_secret = '************************************************'
dc = Connector("twitter", _auth={"client_id":client_id, "client_secret":client_secret})
dc.show_schema("tweets")
df = dc.query("tweets", q="covid-19", _count=10000)
df.head()
cdf = df.copy()
cdf = cdf[cdf["iso_language_code"] == "en"].reset_index()
cdf.head()
plot(cdf, "text")
df_random = dc.query("tweets", q=False, _count=10000)
df_random = df_random[df_random["iso_language_code"] == "en"].reset_index()
plot(df_random, "text")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment