Skip to content

Instantly share code, notes, and snippets.

View gbolmier's full-sized avatar

Geoffrey Bolmier gbolmier

  • HouseSigma
  • Washington DC
  • 13:23 (UTC -04:00)
  • LinkedIn in/gbolmier
View GitHub Profile
import argparse
from pathlib import Path
def clean_html_nb_cells(
content: str, start_pattern: str, end_pattern: str
) -> str:
while start_pattern in content:
start_ix = content.find(start_pattern)
end_ix = start_ix + content[start_ix:].find(end_pattern)
new_content = content[:start_ix] + content[end_ix:]
@gbolmier
gbolmier / sklearn_legend_for_changelogs.md
Created June 28, 2023 13:05
scikit-learn legend for changelogs in GitHub Flavored Markdown with shields.io

Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge

Legend

@gbolmier
gbolmier / timer.py
Created April 22, 2020 20:47
⏳ A python timer decorator
import time
from functools import wraps
from math import trunc
def timer(text=''):
"""Decorator, prints execution time of the function decorated.
Args:
@gbolmier
gbolmier / parse_trec07p.py
Last active September 6, 2019 22:07
Code ran to build trec07p CSV available in `creme` library
import email
import warnings
import pandas as pd
from bs4 import BeautifulSoup
def parse_body(message):
"""Parses text body from email message object with BeautifulSoup.