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 timeseries_vertices(ser:pd.Series, distance=15, coeff=3): | |
name = ser.name | |
# remove intermediate vertices on lines | |
def no_lines(df): | |
df.loc[:, 'gt_before'] = df.loc[:, name] > df.loc[:, name].shift(1) | |
df.loc[:, 'gt_after'] = df.loc[:, name] > df.loc[:, name].shift(-1) | |
df.loc[:, 'is_peak'] = df.loc[:, 'gt_before'] == df.loc[:, 'gt_after'] | |
df = df.loc[df.loc[:, 'is_peak'], :].copy() |
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
[ | |
{"side": "SELL", "tulips": 15, "tulip_price": 111.5, "transaction_date": "2022-02-01T00:00:00.250000"}, | |
{"side": "BUY", "tulips": 15, "tulip_price": 107.5, "transaction_date": "2022-02-01T00:30:00.250000"}, | |
{"side": "BUY", "tulips": 15, "tulip_price": 107, "transaction_date": "2022-02-01T01:30:00.250000"}, | |
{"side": "SELL", "tulips": 20, "tulip_price": 104.5, "transaction_date": "2022-02-01T02:00:00.250000"}, | |
{"side": "BUY", "tulips": 10, "tulip_price": 105, "transaction_date": "2022-02-01T02:00:00.250000"}, | |
{"side": "SELL", "tulips": 15, "tulip_price": 112.5, "transaction_date": "2022-02-01T03:00:00.250000"}, | |
{"side": "BUY", "tulips": 15, "tulip_price": 111.5, "transaction_date": "2022-02-01T03:30:00.250000"}, | |
{"side": "SELL", "tulips": 20, "tulip_price": 111.0, "transaction_date": "2022-02-01T04:00:00.250000"}, | |
{"side": "BUY", "tulips": 15, "tulip_price": 109.5, "transaction_date": "2022-02-01T04:30:00.250000"} |
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
FROM python:3.7.7-slim-buster | |
RUN python -m venv /opt/venv | |
ENV PATH="/opt/venv/bin:$PATH" | |
RUN mkdir -p /usr/share/man/man1 | |
RUN apt-get update && \ | |
apt-get install -y default-jre && \ | |
apt-get -y install dbus-x11 xfonts-base xfonts-100dpi xfonts-75dpi xfonts-cyrillic xfonts-scalable && \ |
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
TS_DATE_FORMAT_DB_ISO = '%Y-%m-%dT%H:%M:%S,%f' # comma works for mongodb and is valid ISO | |
def datetimeindex_to_UTC(_dti): | |
dti = _dti.copy(deep=True) | |
if 'tz' not in dti or dti.tz is None: | |
dti = dti.tz_localize('UTC') | |
else: | |
dti = dti.tz_convert('UTC') | |
dti = dti.dt.strftime(TS_DATE_FORMAT_DB_ISO).astype(str).str.slice(0, -3) | |
return dti |
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
import csv | |
import os | |
from pathlib import Path | |
from typing import List | |
from databay import Outlet, Update, Record, Link | |
from databay.inlets import RandomIntInlet | |
from databay.outlet import MetadataKey | |
from databay.outlets import CsvOutlet |
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
offset = [thisComp.width, thisComp.height]/2 | |
p1 = thisComp.layer("P1").toComp([0,0]).slice(0,2) - offset | |
p2 = thisComp.layer("P2").toComp([0,0]).slice(0,2) - offset | |
t1 = thisComp.layer("T1").toComp([0,0]).slice(0,2) - offset - p1 | |
t2 = thisComp.layer("T2").toComp([0,0]).slice(0,2) - offset - p2 | |
ps = [p1, p2] | |
in_tangents = [[0,0], t2] | |
out_tangents = [t1, [0,0]] | |
createPath(ps, in_tangents, out_tangents, is_closed=false) |
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
*** Originally built for my mate Sam as part of our mentoring sessions. See: https://youtu.be/TXoDvTJuEb0 *** | |
#################### | |
WEATHER FINDER BASIC | |
#################### | |
Utilise an online weather API to fetch and display current weather information based on the city and country code provided. | |
################### |
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
-- Reboot -- | |
Oct 28 08:46:32 gateway systemd[1]: Starting Google Compute Engine Startup Scripts... | |
Oct 28 08:46:33 gateway startup-script[483]: INFO Starting startup scripts. | |
Oct 28 08:46:33 gateway startup-script[483]: INFO Found startup-script in metadata. | |
Oct 28 08:46:38 gateway startup-script[483]: INFO startup-script: Unable to find image 'google/cloud-sdk:latest' locally | |
Oct 28 08:46:39 gateway startup-script[483]: INFO startup-script: latest: Pulling from google/cloud-sdk | |
Oct 28 08:46:39 gateway startup-script[483]: INFO startup-script: e4c3d3e4f7b0: Pulling fs layer | |
Oct 28 08:46:39 gateway startup-script[483]: INFO startup-script: 56c33728d4fb: Pulling fs layer | |
Oct 28 08:46:39 gateway startup-script[483]: INFO startup-script: bfce832607f8: Pulling fs layer | |
Oct 28 08:46:39 gateway startup-script[483]: INFO startup-script: f6a95ba73cf4: Pulling fs layer |
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
from keras import Input, Model | |
from keras.callbacks import Callback | |
from keras.layers import Dense, BatchNormalization, Lambda, Flatten, Dropout | |
import numpy as np | |
from sklearn.metrics import roc_auc_score | |
import tensorflow as tf | |
from keras import backend as K | |
# generate random test data | |
m = 10000 |
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
; Usage: | |
; 1. Open Premiere | |
; 2. Select the bin you'd like to preload, even better - fullscreen it using tilde ` key. | |
; (Make sure you're in Icon View, not List View) | |
; 3. Run this script | |
; 4. Manually input the number of items in the bin | |
; 5. You can grab a coffee or browse internet in the meantime (though be aware keyboard may not work 100% well) | |
; 6. Repeat for each bin you'd like to preload | |
#Persistent |
NewerOlder