Skip to content

Instantly share code, notes, and snippets.

View westonplatter's full-sized avatar

westonplatter

View GitHub Profile
@westonplatter
westonplatter / entropy_pooling.py
Created August 24, 2022 18:57 — forked from choffstein/entropy_pooling.py
Attilio Meucci's Entropy Pooling
import numpy
import scipy.optimize
import pandas
def probability_constraint(x):
j, n = x.shape
Aeq = numpy.ones([1, j])
beq = numpy.array([1.])
@westonplatter
westonplatter / aggregate-artifacts.yaml
Last active August 21, 2020 18:03 — forked from foobarbecue/aggregate-artifacts.yaml
An example of using parameters to loop through artifact paths
apiVersion: v1
kind: ConfigMap
metadata:
name: workflow-controller-configmap
namespace: default
data:
artifactRepository: |
archiveLogs: true
s3:
repoName: MyArtifactRepo
require 'csv'
require "bigdecimal"
require 'rubygems'
require 'bundler/setup'
require 'pry'
Bundler.require
file_name = "mes-july2020.csv"
@westonplatter
westonplatter / cities.json
Created April 25, 2020 03:47 — forked from Miserlou/cities.json
1000 Largest US Cities By Population With Geographic Coordinates, in JSON
[
{
"city": "New York",
"growth_from_2000_to_2013": "4.8%",
"latitude": 40.7127837,
"longitude": -74.0059413,
"population": "8405837",
"rank": "1",
"state": "New York"
},
from datetime import datetime, timedelta, date
import pytz
from os import environ, path, makedirs
import pandas as pd
import quandl
import fasterparquet
start_date = "1995-01-01"
# Pandas operations
## getting and setting df rows
credit goes to https://stackoverflow.com/a/29262040/665578
for i, row in df.iterrows():
ifor_val = something
if <condition>:
ifor_val = something_else

Commandline Superpowers

Tmux

Session

  • rename. Ctrl + b, $
  • new window. Ctrl + b, c

Vim

from slacker import Slacker
#
# https://api.slack.com/custom-integrations/legacy-tokens
#
token = "--- put api token here ---"
slack = Slacker(token)
#
# Get users list
using System;
using System.Linq;
using QuantConnect.Indicators;
using QuantConnect.Models;
namespace QuantConnect.Algorithm.Examples
{
/// <summary>
///
/// QuantConnect University: EMA + SMA Cross
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECww
LjQ3ODI2MDg3IDAuMTQ1MTA0MzYgMC4xMTY4ODEyMSAwLjg1MDAwMDAyABABgALSEBES
E1okY2xhc3NuYW1lWCRjbGFzc2VzV05TQ29sb3KiEhRYTlNPYmplY3RfEA9OU0tleWVk