Skip to content

Instantly share code, notes, and snippets.

@dalejung
dalejung / open close range 5218284 [5218284].ipynb
Last active July 3, 2023 01:24
open close range 5218284 [5218284].ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dalejung
dalejung / Untitled1.ipynb
Last active July 2, 2023 03:09
Untitled1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dalejung
dalejung / GroupBy by irregular bins 3428504 [3428504].ipynb
Last active September 18, 2021 03:49
GroupBy by irregular bins 3428504 [3428504].ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dalejung
dalejung / bad_assert-1.ipynb
Last active September 18, 2021 00:19
bad_assert-1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dalejung
dalejung / GroupBy Filter 4172758 [4172758].ipynb
Last active September 17, 2021 18:09
GroupBy Filter 4172758 [4172758].ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dalejung
dalejung / event study [6706279].ipynb
Last active September 16, 2021 21:07
event study [6706279].ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dalejung
dalejung / axis slicer [6712594].ipynb
Last active September 16, 2021 21:07
axis slicer [6712594].ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dalejung
dalejung / bingrouper transform.ipynb
Last active September 16, 2021 19:21
bingrouper transform.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dalejung
dalejung / converion.py
Created August 7, 2012 16:55
pandas <-> xts
# https://github.com/dalejung/trtools/blob/master/trtools/rpy/conversion.py
import sys, copy, os, itertools
import rpy2.robjects as robjects
import rpy2.rinterface as rinterface
from rpy2.robjects.vectors import SexpVector, ListVector
from rpy2.robjects.robject import RObjectMixin, RObject
import rpy2.robjects as robj
import numpy as np
import pandas.rpy.common as rcom
@dalejung
dalejung / json.sh
Created August 7, 2016 18:59
json.sh
function tempjson() {
temp_file=$(mktemp)
while read -r LINE; do
echo $LINE >> "$temp_file"
done
export _temp_json=$temp_file
}
alias jcli="tempjson && ipython -i -c \"import json, os; f = open(os.environ['_temp_json']); data = json.load(f); f.close()\""