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
# Created by https://www.toptal.com/developers/gitignore/api/tex,latex,linux,macos,python,dbeaver,pycharm,windows,jupyternotebooks,visualstudiocode,obsidian | |
# Edit at https://www.toptal.com/developers/gitignore?templates=tex,latex,linux,macos,python,dbeaver,pycharm,windows,jupyternotebooks,visualstudiocode,obsidian | |
## Syncthing ## | |
.stfolder/ | |
.stversions/ | |
### DBeaver ### | |
# ide config file |
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
# References: | |
# [1] https://stackoverflow.com/questions/15705630/get-the-rows-which-have-the-max-value-in-groups-using-groupby | |
# Get data | |
import pandas as pd | |
df = pd.DataFrame({'category': ['banana', 'eggs', 'eggs', 'full cream milk', 'full cream milk', 'full cream milk'], | |
'unit_quantity': ['1EA', '100G', '100ML', '100G', '100ML', '1L'], | |
'Count': [5, 22, 1, 5, 1, 38],}, | |
index = [0, 1, 2, 3, 4, 5]) |
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
fig, ax = plt.subplots() | |
ax = sns.barplot(x=df.index, y=df["Column"]) | |
ax.set_xlabel("X Label") | |
x = list(df["Bins"].astype(str).values) | |
x[-1] = f'{df["Bins"].max().left}+' | |
plt.xticks(df.index, x) |
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
try: | |
import module | |
except ModuleNotFoundError: | |
exc_info = sys.exc_info() | |
traceback.print_exception(*exc_info) | |
del exc_info |
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 sys | |
import traceback | |
from collections.abc import Iterable | |
from typing import Union | |
from hyperopt import STATUS_FAIL, STATUS_OK, Trials, fmin, hp, tpe | |
import pandas as pd | |
import numpy as np | |
import scipy as sp | |
from sklearn.model_selection import KFold, StratifiedKFold |
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
fig, ax = plt.subplots(figsize=(20, 10)) | |
ax = sns.lineplot(x=xticks, y=y, ax=ax) | |
plt.xticks(xticks, data["datetime_column_label"].astype(str), rotation=30, ha="right") |
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 collections.abc import Iterable | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
import networkx as nx | |
import numpy as np | |
def make_graph(nodes: Iterable, M: np.ndarray, G: nx.classes.digraph.DiGraph=nx.DiGraph()): | |
"""Build graph based on list of nodes and a weight matrix |
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 bash | |
# This file automatically updates the versions of files setup.py and __init__.py | |
# based on the latest git tag and the release branch name | |
# Copy this file to .git/hooks/ | |
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) | |
BRANCH_TYPE=$(echo ${BRANCH_NAME}| cut -d/ -f1) | |
NEXT_VERSION=$(echo ${BRANCH_NAME} | cut -d "v" -f2- | cut -d "v" -f2-) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.