Skip to content

Instantly share code, notes, and snippets.

@omo
Created February 3, 2015 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omo/2e2926f3646a223ef561 to your computer and use it in GitHub Desktop.
Save omo/2e2926f3646a223ef561 to your computer and use it in GitHub Desktop.
counts.py w/ Pandas
import pandas as pd
import json
import sys
import datetime as dt
data = json.load(open(sys.argv[1]))
df = pd.DataFrame(data["entries"])
df['date'] = pd.to_datetime(df['date'])
# non merge - This doesn't affect the trend it turned out.
df = df[False == df['subject'].str.contains("Merge")]
# recent
limit = dt.datetime.now() - dt.timedelta(360)
df = df[df['date'] > limit]
print df.groupby('author').count().sort("date", ascending=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment