Created
March 22, 2016 22:29
-
-
Save abhigenie92/b4a040f3d5267a604329 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
I want to plot the number of items in each quarter of the year. But the results are incorrect. | |
'incorrect'- There are more items in the earlier years plotted than later. Though analyzing the dataset it should be opposite. | |
df.head() | |
date username | |
0 2007-08-09 ginaemiko | |
1 2007-07-30 AtomAnt | |
2 2008-07-08 RecoveryTweet | |
3 2008-07-05 RecoveryTweet | |
4 2008-06-29 lwu | |
ax=df.date.groupby([df.date.dt.year, df.date.dt.quarter]).count().plot(kind="bar") | |
ax.set_xlabel('Time (Year, Quarter)', fontsize=16) | |
ax.set_ylabel('Count', fontsize=16) | |
plt.tight_layout() | |
plt.savefig('./plots/tweets_quarter.png',dpi=200) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment