Skip to content

Instantly share code, notes, and snippets.

@emmanuelle
emmanuelle / skimage-analytics-choropleth.py
Created December 11, 2019 04:01
Choropleth chart of scikit-image website visits
import plotly.express as px
import pandas as pd
# Analytics file downloaded from matomo, each line is a visit
df = pd.read_csv('december10-skimage.csv', encoding='utf-16le')
df['unit'] = 1
df['hour'] = pd.to_datetime(df['serverTimePretty']).dt.hour
# For each country and hour, count number of visitors
dfg = df[['unit', 'country', 'hour']].groupby(['country', 'hour']).sum()
dfg.reset_index(inplace=True)
from github import Github
import plotly.express as px
from datetime import datetime
# First create a Github instance
# using an access token
g = Github("your own token here")
repo = g.get_repo("scikit-image/scikit-image")
@emmanuelle
emmanuelle / skimage_weekly_update.py
Last active April 17, 2020 13:40
Use github API to print weekly updates for a given project (here scikit-image)
from github import Github
from datetime import datetime
# Change start date here
start = datetime(2020, 4, 6)
def print_list(l, title=None):
"""From list of PullRequest of Issue objects,
print their number and title.