<jupyter_start><jupyter_text>Commits<jupyter_code>import pandas
import plotly.plotly as plot
import cufflinks
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
import plotly.figure_factory as ff
init_notebook_mode(connected=True)<jupyter_output><empty_output><jupyter_text>Raw Data<jupyter_code>data = pandas.read_csv('./commit_history.csv')
data['date'] = pandas.to_datetime(data['date'])
data = data.loc[~data.message.str.startswith('Merge')]
data<jupyter_output><empty_output><jupyter_text>Commits / Year<jupyter_code>data_by_year = data.groupby(data.date.dt.year)
commits_per_year = data_by_year.size()
iplot(commits_per_year.iplot(asFigure=True, dimensions=(750, 500), kind="bar", yTitle="Number of Commits", xTitle="Year"))<jupyter_output><empty_output><jupyter_text>Percentage of change of number of commits compared to previous year<jupyter_code>iplot(commits_per_year.pct_change().iplot(asFigure=True, dimensions=(750, 500), kind='bar', yTitle="Percentage of Change", xTitle="Year"))<jupyter_output><empty_output><jupyter_text>Commiters / Year<jupyter_code>committers_per_year = data_by_year.author.nunique()
iplot(committers_per_year.iplot(asFigure=True, dimensions=(750, 500), kind="bar", yTitle="Number of Commiters", xTitle="Year"))<jupyter_output><empty_output><jupyter_text>Percentage of change of number of committers compared to previous year<jupyter_code>iplot(committers_per_year.pct_change().iplot(asFigure=True, dimensions=(750, 500), kind="bar", yTitle="Percentage of Change", xTitle="Year"))<jupyter_output><empty_output><jupyter_text>Commits/Committer per Year<jupyter_code>c = committers_per_year.to_frame(name='committers').join(commits_per_year.to_frame(name='commits'))
c['commits_per_committer'] = c['commits']/c['committers']
iplot(c.loc[:, 'commits_per_committer'].iplot(asFigure=True, dimensions=(750, 500), kind="bar"))<jupyter_output><empty_output><jupyter_text>Number of Commits/Author/Year<jupyter_code>data_by_author_year = data.groupby([data.date.dt.year, data.author])
commits_per_author_year = data_by_author_year.size().unstack(0).fillna(0)
commits_per_author_year<jupyter_output><empty_output><jupyter_text>Number of Commits per Year by a specific Author<jupyter_code>iplot(commits_per_author_year.loc['<NAME>'].iplot(asFigure=True, dimensions=(750, 500), kind="bar"))<jupyter_output><empty_output><jupyter_text>Committer Stats<jupyter_code>data.groupby(data.author).agg({
    'date': ['size'],
    'lines': ['sum', 'mean', 'min', 'max'],
    'insertions': ['sum', 'mean', 'min', 'max'],
    'deletions': ['sum', 'mean', 'min', 'max'],
    'net': ['sum', 'mean', 'min', 'max'],
}).sort_values([('date', 'size')], ascending=False).iloc[:20,:]<jupyter_output><empty_output><jupyter_text>Commiter Stats per Year<jupyter_code>data_by_author_year.agg({
    'date': ['count'],
    'lines': ['sum', 'mean', 'min', 'max'],
    'insertions': ['sum', 'mean', 'min', 'max'],
    'deletions': ['sum', 'mean', 'min', 'max'],
    'net': ['sum', 'mean', 'min', 'max'],
})<jupyter_output><empty_output><jupyter_text>Number of commits per Day<jupyter_code>daily = data.set_index('date').resample('D').size()
monthly_mean = daily.resample('M').mean()
monthly_mean.index = monthly_mean.index.strftime('%Y/%m')
iplot(monthly_mean.iplot(asFigure=True, dimensions=(750, 500)))
iplot(monthly_mean[-36:].iplot(asFigure=True, dimensions=(750, 500), vline=['2017/09', '2017/03', '2016/09', '2016/03', '2015/09']))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1786636076856897, 'fraction_numerical': 0.02408947519357614, 'mean_word_length': 10.36156351791531, 'pattern_counts': {'":': 0, '<': 50, '<?xml version=': 0, '>': 50, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '12', 'dir': 'jupyter-structured-clean-dedup', 'id': '545211', 'license': 'Apache-2.0', 'n_tokens_mistral': 1355, 'n_tokens_neox': 1282, 'n_words': 183, 'path': 'commits.ipynb', 'repo_name': 'mayflower/nixpkgs-stats', 'size': '3494'}