Skip to content

Instantly share code, notes, and snippets.

View ahcyip's full-sized avatar

Arthur Yip ahcyip

View GitHub Profile
library(tidyverse)
# Let's generate our different trials data
# and save to rds
test_if_sameness <- function(size_of_group) {
tibble(person_id = 1:size_of_group) %>%
mutate(birthday = sample(1:365, n(), replace = T)) %>%
mutate(other_dates = list(rename(., person_id1 = person_id,
birthday1 = birthday))) %>%
'''
Netfonds import 5 days of intraday data
'''
import numpy as np
import pandas as p
from pandas.tseries.offsets import *
import datetime as dt
import matplotlib.pyplot as plt
size = (14,10)
@ahcyip
ahcyip / google_finance_intraday.py
Created June 22, 2018 02:43 — forked from lebedov/google_finance_intraday.py
Retrieve intraday stock data from Google Finance.
#!/usr/bin/env python
"""
Retrieve intraday stock data from Google Finance.
"""
import csv
import datetime
import re
import pandas as pd
@ahcyip
ahcyip / extract_mbox_attachments.py
Created April 14, 2018 11:26 — forked from georgy7/extract_mbox_attachments.py
Extract all attachments from mbox file (in order of appearance in the file).
# Modified.
# Original script source:
# http://blog.marcbelmont.com/2012/10/script-to-extract-email-attachments.html
# Usage:
# Run the script from a folder with file "all.mbox"
# Attachments will be extracted into subfolder "attachments"
# with prefix "n " where "n" is an order of attachment in mbox file.
import mailbox, pickle, traceback, os
@ahcyip
ahcyip / RTFM.md
Created September 10, 2017 19:03 — forked from jiahao/RTFM.md
How to add yourself to the free-food mailing list at MIT