Skip to content

Instantly share code, notes, and snippets.

View jfthuong's full-sized avatar

Jean-Francois Thuong jfthuong

View GitHub Profile
@jfthuong
jfthuong / get_weather.py
Created May 17, 2023 09:16
Getting Weather in DataFrame
import requests
from datetime import datetime
import pandas as pd
BREST = (48.39029, -4.4833)
NANTES = (47.218371, -1.553621)
DFLT_START = datetime(2018, 1, 1)
DFLT_END = datetime.today()
@jfthuong
jfthuong / scratchpad.ipynb
Last active November 15, 2021 08:38
Deploying CV Classification Model
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
digraph unpackAI_progression {
rankdir="LR";
graph [fontname = "Handlee"];
node [fontname = "Handlee"];
edge [fontname = "Handlee"];
bgcolor=transparent;
subgraph cluster_ml {
@jfthuong
jfthuong / solution.py
Last active January 9, 2019 10:13
WPE #15 CheckPickle
from cmd import Cmd
from glob import glob
import pickle
import re
from time import time
from typing import Dict, List
fields = ["first_name", "last_name", "email"]
@jfthuong
jfthuong / solution.py
Last active October 17, 2018 14:48
WPE - Week 04 - Solution
from collections import defaultdict, namedtuple
from datetime import datetime
import pandas as pd # type: ignore # "No library stub" for pandas
import re
import sys
from timeit import timeit
from typing import Any, Callable, Dict, Iterator, List, Tuple
DictLog = Dict[str, str]
ListLogs = List[DictLog]
@jfthuong
jfthuong / test_solution_W03.py
Created October 11, 2018 05:46
Test of Solution for WPE Week 2
#!/usr/bin/env python3
import solution
logfilename = "mini-access-log.txt"
def test_read_logs():
log_list = solution.logtolist(logfilename)
assert len(log_list) == 206
@jfthuong
jfthuong / test_solution_W02.py
Created October 11, 2018 01:46
Test of Solution for WPE Week 2
#!/usr/bin/env python3
import solution
import pytest
list_test_inputs = [
(10,),
(10, 20),
(20, 10),
@jfthuong
jfthuong / solution.py
Last active October 11, 2018 01:37
WPE - Week 02 - Solution
import timeit
from typing import Dict, Generator, List
Range3 = Generator[int, None, None]
def myrange3(start: int, stop: int = None, step: int = 1) -> Range3:
if stop is None:
current, stop = 0, start
@jfthuong
jfthuong / solution.py
Last active September 28, 2018 02:53
WPE - Week 01 - Solution
#!/python
from collections import defaultdict, Counter
# BONUS: fuzzy logic when entering countries and cities
try:
from fuzzywuzzy import fuzz
FUZZY_ENABLED = True
print("")
except ImportError as e:
@jfthuong
jfthuong / svn_revert_clean.py
Created October 20, 2015 10:49
Script to remove unversioned files and perform svn revert
#!python
import os
import re
import sys
import subprocess
'''
svn_revert_clean.py - script to remove unversioned files and perform svn revert