Skip to content

Instantly share code, notes, and snippets.

View smarie's full-sized avatar
💭
I may be slow to respond.

Sylvain Marié smarie

💭
I may be slow to respond.
View GitHub Profile
@smarie
smarie / teams_meeting_attendance_analysis.py
Last active January 15, 2021 10:45
This script processes the attendance list csv from a teams meeting, and plots some useful graphs
import pandas as pd
import matplotlib.pyplot as plt
# --------------- You may need to change this -------------
file_name = "meetingAttendanceList.csv"
user_fullname_colname = "Nom complet"
user_action_colname = "Action de l’utilisateur"
joined_text = "Rejoint"
left_text = "A quitté l'appel"
date_and_time_colname = "Date et heure"
@smarie
smarie / timers_comparison.py
Last active March 21, 2020 12:53
An experiment comparing the various timers available on the python platform.
"""
An experiment comparing the various timers available on the python platform.
For each available timer (see `TIMER_METHODS` below), the following experiment is run:
- spawn `nb_processes` parallel processes
- each process performs a `for` loop with `nb_occ` iterations.
- each iteration uses the timer to measure the execution time around a `time.sleep(sleep_duration)` call
All experiments are run in sequence, one after the other.
The results are displayed as boxplots using matplotlib.
@smarie
smarie / tree.py
Created February 24, 2020 12:43
Python 2-3 code showing equivalent of `tree` command, based on `treelib`. The intent is not to be efficient but to demonstrate `Tree.show()` method. See https://gist.github.com/jvrplmlmn/5755890 for a more efficient implementation that does not build the tree in memory.
from treelib import Tree
from os import walk
try: # python 3+
from pathlib import Path
except ImportError:
from pathlib2 import Path
def get_fs_tree(start_path, # type: str