Skip to content

Instantly share code, notes, and snippets.

library(babynames)
library(tidyverse)
library(scales)
theme_set(theme_bw())
################################################################################
## Tweets Day 1
library(tidyverse)
library(shades)
n_rectangles <- 10000
rect_scale_factor <- 1.5
canvas_size <- 100
xlims <- c(0, canvas_size)
ylims <- c(0, canvas_size)
height <- 2
width <- 7
# Chris Riederer
# 2020-05-28
# Make radial plot of baby's sleep times.
# To get data, make sure pip is installed. Then:
# pip install snoo
# snoo sessions --start START_DATE --end END_DATE > all_snoo_sessions.csv
################################################################################
@dodger487
dodger487 / baby_sleep.py
Last active May 25, 2020 16:58
Visualize baby's sleep data
# Chris Riederer
# 2020-05-24
"""Visualize Baby's snoo data."""
import datetime
import pandas as pd
from plotnine import *
"""Print out text of emails from MBox file."""
from collections import Counter
import mailbox
import sys
import re
mbox = mailbox.mbox("friends-001.mbox")
# Chris Riederer
# 2019-06-27
"""Toy experiment with reinforcement learning."""
from collections import Counter
import random
import time
import numpy as np
# 2019-06-24
# Python 3 plz
"""What would the result of a ranked choice election be given the data from
Data For Progress's survey?
https://www.dataforprogress.org/blog/2019/6/24/who-else-are-the-major-candidates-supporters-considering
http://filesforprogress.org/datasets/june_19_omni/
"""
# Chris Riederer
# 2019-02-28
# When should you invest your 401k?
library(quantmod)
library(dplyr)
library(ggplot2)
# Pull in S&P data from Yahoo Finance
getSymbols("^GSPC", src="yahoo")
@dodger487
dodger487 / stocks.R
Created March 22, 2017 14:47
A brief look at election's effect on S&P 500
# Chris Riederer
# 2017-03-21
# Look at election's impact on stock market
library("MASS")
library(quantmod)
library(dplyr)
library(ggplot2)
# Pull in S&P data from Yahoo Finance
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>