This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from arpeggio.cleanpeg import ParserPEG | |
from arpeggio import PTNodeVisitor, visit_parse_tree | |
GRAMMAR=r""" | |
full = expr EOF | |
expr = var / function / application | |
function = "/" var "." expr | |
application = "(" expr expr ")" | |
var = r"\w+" | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import unicodedata | |
STATE_FIND_STREETNAME = 1 | |
STATE_FIND_FIRST_NUMBER = 2 | |
STATE_FIND_SECOND_NUMBER = 3 | |
STATE_ALL_FOUND = 4 | |
def normalize_street( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import contextlib as __stickytape_contextlib | |
@__stickytape_contextlib.contextmanager | |
def __stickytape_temporary_dir(): | |
import tempfile | |
import shutil | |
dir_path = tempfile.mkdtemp() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import contextlib as __stickytape_contextlib | |
@__stickytape_contextlib.contextmanager | |
def __stickytape_temporary_dir(): | |
import tempfile | |
import shutil | |
dir_path = tempfile.mkdtemp() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:toc: | |
:toc-placement: left | |
toc::[] | |
== Summary | |
* mostly from https://otexts.org/fpp2/[Forecasting: Principles and Practice (Hyndman, Athanasopoulos)] | |
* "stationary": properties do not depend on absolute time (e.g. fixed time seasons; but may have cycles due to dependence on past values) | |
* centered moving average will smooth out seasons (e.g. 1/8,1/4,1/4,1/4,1/8) | |
* maybe transform data if want to restrict to range (e.g. log for positive values) or variances are changing (e.g. Box-Cox transform) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import reduce | |
from operator import add | |
def monoid(combine, create=lambda x:x): | |
def wrapped(val): | |
return Monoid(combine, create(val)) | |
return wrapped | |