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 skopt.space import Real, Integer | |
from skopt.utils import use_named_args | |
from skopt import gp_minimize | |
from xgboost import XGBClassifier | |
from sklearn.model_selection import cross_val_score | |
cls = XGBClassifier() |
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 difflib import SequenceMatcher | |
def longestSubstring(str1,str2): | |
# initialize SequenceMatcher object with | |
# input string | |
seqMatch = SequenceMatcher(None,str1,str2) | |
# find match of longest sub-string | |
# output will be like Match(a=0, b=0, size=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
def bin_size(x): | |
""" | |
https://en.wikipedia.org/wiki/Freedman%E2%80%93Diaconis_rule | |
""" | |
return (2 * (np.nanquantile(x, 0.75) - np.nanquantile(x, 0.25)) / | |
np.cbrt(len(x[~np.isnan(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
import tempfile | |
import requests | |
from importlib.machinery import SourceFileLoader | |
def import_remote_module(module_name, url): | |
""" | |
import a file from a URL, given by `url` | |
--- | |
returns the imported module |
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 os | |
import subprocess | |
import sys | |
import argparse | |
def install_all(): | |
path = os.path.dirname(os.path.abspath(__file__)) | |
packages = [p for p in next(os.walk(path))[1] | |
if "setup.py" in os.listdir(p)] |
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
license: gpl-3.0 | |
height: 600 |
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
(defun parse-entry () | |
(let* ((data (org-heading-components)) | |
(link-string (nth 4 data)) | |
(tags-string (nth 5 data)) | |
(link-match (s-match "\\[\\[\\(\\([^\]\:]*\\)\://[^\]]*\\)\\]\\[\\([^\]\:]*\\)\\]\\]" link-string)) | |
(link (nth 1 link-match)) | |
(protocol (nth 2 link-match)) | |
(title (nth 3 link-match)) | |
(dummy (message title)) | |
(tags (if tags-string |
This file has been truncated, but you can view the full 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/> | |
<title>HiPlot</title> | |
<link href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB2gAAAaWCAMAAABPsR1DAAACkVBMVEVMaXFCGHdCGHfPaVE5NYDeYWTPoiFCGHdCGHdCGHfkoRMuVoquSmqYYULkZGNCGHdCGHdCGHfOaVJCGHdCGHcA5bZCGHcA5bYA5bYA5bYA5bYA5bYA5bYA5bYA5bYA5bYA5bYA5bZCGHdCGHf/cGAA5bb/cGD/cGD/cGD/cGD/cGD/cGD/cGD/cGBCGHcA5bb/cGD/cGAmcJIA5bbenBb/cGBCGHfLjCL/cGD/cGD/cGDbmRj4sgf0rwnmoxLSkh7sqA3UlB3dmxfppRD0a2H7tQTgnhWsSWrSW2bmZGPdYGTbX2TsZ2L7bmDUXGWscjXLWGbpZmP4bWHgYmTkoRPvqwzZmBnZXmXkY2PvaWLKiyP/uAL/uAL/uALGiCX/uAIUp6MWoaH/uAITqqQVpaLBgyn/uAL/uAL/uAL/uAIWoaERr6XAgym/gSoSraUTq6T/uAL/uAL/uAIXn6ESraXEhifIiiTLjCIUpaLIiiTEhibNjiETqqT/uAISraUVo6IUp6P/uALChSj/uALLjCLGiCXjoBPKZlTOaFLbnRjjY2PgnhWmY0bKiyM/IHktWYv1tgm8nS7eaFrtbVtncWVYInTIqCdgMWUKxqxCGHf/cGAA5bb/uAK9gCsXnaDamRn3sQfmoxLSkh7BgynioBTyrQrFhybqpg/JiiP7tAXVlRwQtKcJyq4D3LMC4LUNvaoTqqQUpqMHzq8OuKgKxqwWoaEE17LvqgzenBfNjiEG07ERr6XJfTXWej/aeUIMwavzc1bmdkzid0nBfy73clr7cV3FfjLrdVDSezzxtgtDooK3s |
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
#cloud-config | |
autoinstall: | |
version: 1 | |
early-commands: | |
- systemctl stop ssh # otherwise packer tries to connect and exceed max attempts | |
network: | |
network: | |
version: 2 | |
ethernets: | |
eth0: |
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 | |
import requests | |
from lxml import html, etree | |
from datetime import datetime as date | |
from fire import Fire | |
base_url = 'http://www.euribor-rates.eu/en/euribor-rates-by-year/{}/' | |
def shorten_label(label): |