Skip to content

Instantly share code, notes, and snippets.

Alexander Engelhardt AlexEngelhardt

View GitHub Profile
@AlexEngelhardt
AlexEngelhardt / git_examples.sh
Created Feb 4, 2020 — forked from radum/git_examples.sh
this script creates repos in a sandbox directory and uses them for demos -
View git_examples.sh
#!/bin/bash
##########
# contents
# https://bitbucket.org/BitPusher16/dotfiles/src/12a5ee615d42dce417b8217e82d1ab5bd272cfbd/refs/git/git_examples.sh?at=master
##########
# contents
# notes
# script setup
@AlexEngelhardt
AlexEngelhardt / rle.py
Created Feb 6, 2019
Run Length Encoding in Python
View rle.py
"""Run-Length Encoding."""
import numpy as np
import pandas as pd
from itertools import chain
def rle_encode(ndarr):
"""
Input: ndarray
@AlexEngelhardt
AlexEngelhardt / bird_is_the_word.ipynb
Last active Jul 18, 2017
My first Jupyter notebook
View bird_is_the_word.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AlexEngelhardt
AlexEngelhardt / cv.folds
Created Apr 15, 2015
Function to generate list of test set indices for cross validation
View cv.folds
cv.folds <- function(n, folds = 10) { split(sample(1:n), rep(1:folds, length = n)) }
## cv_indices <- cv.folds(length(testable_rows), K) # list of 10 indices of testable_rows
## cv_groups <- lapply(cv_indices, function(x) testable_rows[x])
@AlexEngelhardt
AlexEngelhardt / multiplot.R
Created Mar 3, 2015
Function to arrange multiple ggplots
View multiplot.R
# From: http://www.cookbook-r.com/Graphs/Multiple_graphs_on_one_page_%28ggplot2%29/
# Multiple plot function
#
# ggplot objects can be passed in ..., or to plotlist (as a list of ggplot objects)
# - cols: Number of columns in layout
# - layout: A matrix specifying the layout. If present, 'cols' is ignored.
#
# If the layout is something like matrix(c(1,2,3,3), nrow=2, byrow=TRUE),
# then plot 1 will go in the upper left, 2 will go in the upper right, and
You can’t perform that action at this time.