1. Overview of astetik’s functionality¶
First let’s get some data (in this case 1000 tweets about Donald Trump. I’m using Somecode Twitter Research kit to get the data directly in to a pandas dataframe from Twitter API
import somecode as some
df = some.search("trump",100)
DataFrame with n=100 for keyword 'trump' created on 2016-11-13 10:45:58 succesfully withour errors.
1.1. List of Functions¶
- Text (e.g. tweeets)
- Descriptive Stats
- Bars
- Side-by-side Histogram
- Bubble Chart (4 dimensions)
- Heatmap Correlation (up to 40 variables)
- Kernel Density Estimation
- Swarming
- OLS Regression test
1.2. Common function parameters¶
Because generally the user is required to spend much time to figure out basic configuration, such as titles, scales etc, astetik is focused on making frequently repeated operations as intuitive accessible as possible.
Example paramaters:
- title / string to be used as a title for the graphic
- suptitle / string to be used as subtitle for the graphic
- xscale / for setting the scale of x axis (“linear”,”symlog”,”log”)
- yscale / see above line
- color / for changing a single color
- palette / for changing a palette of colors (astetik is using Seaborn palettes but you could use any)
2. Examples of text and table presentation¶
The below examples highlight astetik’s functionality when used at the most basic level.
2.1. Tweets with most retweets¶
astetik.text(df,'text',5,sort_by='retweet_count')
2.2. Negative tweets sorted by number of retweets¶
astetik.text(df[df.neg > 0.2],'text',"Negative tweets with many retweets",5,sort_by='retweet_count')
Negative tweets with many retweets
RT @_atypicalsgirls: Truly Inappropriate Trump Photo Gone Viral;;;; https://t.co/q32FShvc7nRT @_onlyfunnytweet: Truly Inappropriate Trump Photo Gone Viral;;;; https://t.co/78F3HyWRV2RT @memesuppIy: "Trump Won. Who's fucked?" https://t.co/5syr1gOy0g"Nuttall looks like a £ucking clown and doesn't even need the make up." Lmao. Always worth reading the comments... https://t.co/I5TfjSeBR5RT @WildeThingy: Dear Donald Trump, please can you first build a wall round gorilla enclosures to keep the toddlers out. #NeverForgetOLS Regression Test¶
astetik.ols(df,'retweet_count','neg','neu','pos')