This file contains 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
""" | |
Template script with input file. | |
Use the module docstring as the script description. | |
Example usage: script.py -a 100 < infile | |
""" | |
import sys | |
from argparse import ArgumentParser, FileType |
This file contains 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
def which(cmd): | |
"""Path to executable `cmd`. | |
Args: | |
cmd (str or list): Name of the executable or list of alternative names. | |
Returns: | |
pathlib.Path: Path to executable (the first recoverable path for a list). | |
""" |
This file contains 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
# -*- coding: utf-8 -*- | |
"""System info""" | |
import platform | |
import sys | |
import numpy | |
import subprocess | |
print( |
This file contains 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
def holidays_df(): | |
""" | |
Return a pd.DataFrame with holiday data for fb prophet. | |
The df has columns 'holiday' (string) and 'ds' (date type) | |
and optionally columns lower_window and upper_window which specify a | |
range of days around the date to be included as holidays. | |
original code here: https://github.com/peridoteagle/brew/blob/master/time_series/prophet.py | |
""" |