In [3]:
import pandas as pd
%matplotlib inline
Open the data file
In [4]:
damd = pd.read_csv("20170718 hashtag_damd uncleaned.csv")
damd.columns
Out[4]:
Let's look at the created variable.
In [5]:
damd['created'].head(3)
Out[5]:
Looks like dates, great. Let's set the data type.
In [13]:
damd['created'] = pd.to_datetime(damd['created'])
damd['created'].head(3)
Out[13]:
Let's group the data by year, and plot the count of items per year as a vertical barchart.
In [30]:
damd['created'].groupby(by=damd['created'].dt.year).count().plot.bar(figsize=(5, 6), title="Tweet activity over years").grid(True, axis="y")
Did the above program create same output as you did in Tableau?
Compare Twitter and Facebook data.
Hand in a visualization on LearnIT.