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
#!/bin/bash | |
apt-get install libxml2-dev libssl-dev libffi-dev libxslt1-dev python-dev libjpeg-dev | |
pip freeze --local >pipfreeze.txt | |
tr '\n' ' ' < pipfreeze.txt >pipfreeze2.txt | |
pip install --upgrade --force-reinstall `cat pipfreeze2.txt` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 click import command, option, Option, UsageError | |
class MutuallyExclusiveOption(Option): | |
def __init__(self, *args, **kwargs): | |
self.mutually_exclusive = set(kwargs.pop('mutually_exclusive', [])) | |
help = kwargs.get('help', '') | |
if self.mutually_exclusive: | |
ex_str = ', '.join(self.mutually_exclusive) | |
kwargs['help'] = help + ( | |
' NOTE: This argument is mutually exclusive with ' |
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 pandas as pd | |
def confusion_matrix(df: pd.DataFrame, col1: str, col2: str): | |
""" | |
Given a dataframe with at least | |
two categorical columns, create a | |
confusion matrix of the count of the columns | |
cross-counts | |
use like: |
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
"""Functions for working with remote files using pandas and paramiko (SFTP/SSH).""" | |
import pandas as pd | |
import paramiko | |
def read_csv_sftp(hostname: str, username: str, remotepath: str, *args, **kwargs) -> pd.DataFrame: | |
""" | |
Read a file from a remote host using SFTP over SSH. | |
Args: |
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
# https://misc.flogisoft.com/bash/tip_colors_and_formatting | |
RED="\\e[91m" | |
GREEN="\\e[32m" | |
BLUE="\\e[94m" | |
YELLOW="\\e[33m" | |
REGULAR="\\e[39m" | |
REPORTS=".coverage-reports" | |
SRC="app" | |
VERSION=$(shell cat ${SRC}/__init__.py | head -n 1 | cut -d" " -f 3 | tr -d "'") |
OlderNewer