Skip to content

Instantly share code, notes, and snippets.

@pcarleton
pcarleton / extract.py
Created February 8, 2021 23:06
Pulling amazon orders data from CSV's
#! /usr/bin/env python
# Imports CSV's for "Items" and "Orders and Shipments" as downloaded
# from: https://www.amazon.com/gp/b2b/reports/
#
# The output of this script is a single JSON file combining the data from both
# files for easier management.
#
#
# It assumes you're dealing with one batch (i.e. 1 Items, 1 Orders) file located
Age Marital Status Sex Work Experience in 2017 Count
0 to 17 Married, Spouse Present Male Worked full-time year-round 4
0 to 17 Married, Spouse Present Male Worked less than full-time year-round 3
0 to 17 Widowed Male Did not work 3
0 to 17 Widowed Female Did not work 5
0 to 17 Divorced Male Worked less than full-time year-round 2
0 to 17 Divorced Female Worked full-time year-round 2
0 to 17 Separated Male Did not work 2
0 to 17 Separated Female Did not work 3
0 to 17 Never Married Male Worked full-time year-round 9
@pcarleton
pcarleton / core inflation
Created April 28, 2018 23:59
https://fred.stlouisfed.org/graph/?graph_id=462858&rn=7598#0 U.S. Bureau of Labor Statistics, Consumer Price Index for All Urban Consumers: All Items Less Food and Energy [CPILFESL], retrieved from FRED, Federal Reserve Bank of St. Louis; https://fred.stlouisfed.org/series/CPILFESL, April 28, 2018.
DATE,CPI_PC1
2006-01-01,2.11055
2006-02-01,2.10632
2006-03-01,2.09895
2006-04-01,2.29770
2006-05-01,2.44389
2006-06-01,2.64207
2006-07-01,2.68790
2006-08-01,2.83441
2006-09-01,2.93095
DATE,CPI_PC1
2006-01-01,2.11055
2006-02-01,2.10632
2006-03-01,2.09895
2006-04-01,2.29770
2006-05-01,2.44389
2006-06-01,2.64207
2006-07-01,2.68790
2006-08-01,2.83441
2006-09-01,2.93095
DATE,CPI_PC1
2006-01-01,2.11055
2006-02-01,2.10632
2006-03-01,2.09895
2006-04-01,2.29770
2006-05-01,2.44389
2006-06-01,2.64207
2006-07-01,2.68790
2006-08-01,2.83441
2006-09-01,2.93095
@pcarleton
pcarleton / federal_reserve_all_assets
Created April 9, 2018 03:58
https://fred.stlouisfed.org/series/WALCL Federal Reserve Balance Sheet in millions of dollars
DATE,WALCL
2002-12-18,719542
2002-12-25,732059
2003-01-01,730994
2003-01-08,723762
2003-01-15,720074
2003-01-22,735953
2003-01-29,712809
2003-02-05,719643
2003-02-12,713281
DATE,EXCSRESNS,RESBALREQ
2005-06-01,1.7390000000000000,9.4190000000000000
2005-07-01,1.7920000000000000,9.7110000000000000
2005-08-01,1.6190000000000000,9.4090000000000000
2005-09-01,1.9950000000000000,9.7100000000000000
2005-10-01,1.8840000000000000,8.3680000000000000
2005-11-01,1.7810000000000000,8.3640000000000000
2005-12-01,1.9000000000000000,8.1460000000000000
2006-01-01,1.5750000000000000,8.6970000000000000
2006-02-01,1.5490000000000000,7.8600000000000000
DATE,IOER
2013-04-04,0.25
2013-04-05,0.25
2013-04-06,0.25
2013-04-07,0.25
2013-04-08,0.25
2013-04-09,0.25
2013-04-10,0.25
2013-04-11,0.25
2013-04-12,0.25
Parameter settings:
LeftEdge = -3791
RightEdge = 4311
TopEdge = 423
BottomEdge = 6027
FingerLow = 70
FingerHigh = 75
MaxTapTime = 180
MaxTapMove = 522
MaxDoubleTapTime = 180
gistup