Skip to content

Instantly share code, notes, and snippets.

---
title: "Is-Behavior-Change-Happening"
author: "frank-corrigan"
date: "3/9/2022"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
---
title: "Marathon-Insights"
author: "frank-corrigan"
date: "3/1/2022"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
# toy simulation to determine how likely or
# unlikely the poll results from blog post
# are (Do you plan to relocate in 2022?)
# load packages
library(dplyr)
library(ggplot2)
# Single Instance ----
from tabula.io import read_pdf
import pandas as pd
import matplotlib.pyplot as plt
# set path to file
pdf_path = "Container-Vessels-In-Port.pdf"
# creates a python list, each page is a list item stored as pandas df
dfs = read_pdf(pdf_path, stream=True, pages='2-10')
# purpose: use changepoint algorithm to determine
# appropriate history range for statistical control charts
# 0.0 Packages ----
library(ggplot2) # for visualizations
library(gridExtra) # for plotting charts together
library(lubridate) # for data manipulations
library(tidyverse) # for piping data
library(reshape2) # for wide to long data transform
library(changepoint) # for finding change points in ts data
# purpose: use changepoint algorithm to benchmark
# Piketty's time buckets for inflationary periods
# 0.0 Packages ----
library(ggplot2) # for visualizations
library(gridExtra) # for plotting charts together
library(lubridate) # for data manipulations
library(tidyverse) # for piping data
library(reshape2) # for wide to long data transform
library(changepoint) # for finding change points in ts data
@FrankRuns
FrankRuns / vision-to-data.R
Created June 20, 2021 21:20
Turning vision docs into data
# packages
library(syuzhet)
library(dplyr)
library(ggplot2)
# subset of text (to start)
limiting_beliefs <- "I never had a plan for my career and now it’s too late.
I wanted to be X, but didn’t start early enough in life and now it’s too late.
I go to work to support my family, not to be fulfilled.
I can’t make enough money doing a job I want to do.
@FrankRuns
FrankRuns / scen-planning-mc-starter.R
Created May 12, 2021 12:14
Script to support scenario planning article
# purpose: support article on scenario planning with monte carlo
# caution: this is a learning script (for me, and you)
# read packages
library(dplyr)
library(ggplot2)
library(tidyr)
library(EnvStats)
library(MASS)
@FrankRuns
FrankRuns / uno-sim.ipynb
Last active January 16, 2024 10:18
Python sim for the card Uno
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
library(tidyverse)
library(ggplot2)
# create holder data frame
data <- data.frame(magic_number=numeric(), equity_fraction=numeric(),
mgmt_span=numeric(), ps_fit=numeric(),
salary_growth=numeric())
# create ranges for variables
s_set <- 1:20