Skip to content

Instantly share code, notes, and snippets.

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 geekygirldawn/a7d3feb5fef7497e793c6b83ffc7eb06 to your computer and use it in GitHub Desktop.
Save geekygirldawn/a7d3feb5fef7497e793c6b83ffc7eb06 to your computer and use it in GitHub Desktop.
import pandas as pd
import matplotlib
import seaborn as sns
import matplotlib.pyplot as plt
pr_all['diff'] = pr_all.first_response_time - pr_all.pr_created_at
pr_all['yearmonth'] = pr_all['pr_created_at'].dt.strftime('%Y-%m')
pr_all['diff_days'] = pr_all['diff'] / datetime.timedelta(days=1)
year_month_list = pr_all.yearmonth.unique()
year_month_list.sort()
first_response_median = pr_all.groupby(['repo_name', 'yearmonth'], as_index=False).median()[['repo_name', 'yearmonth', 'diff_days']]
sns.set_style('ticks')
sns.set(style="whitegrid", font_scale=2)
fig, ax = plt.subplots()
fig.set_size_inches(24, 8)
title = "\nTimely Responses:"
my_plot = sns.boxplot(x='yearmonth', y='diff_days', data=pr_all, ax=ax, order=year_month_list, showfliers = False, whis=3).set_title(title, fontsize=30, color=title_color)
@geekygirldawn
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment