Skip to content

Instantly share code, notes, and snippets.

View reuven's full-sized avatar
💭
Teaching Python and data science around the world

Reuven M. Lerner reuven

💭
Teaching Python and data science around the world
View GitHub Profile
@reuven
reuven / gist:2233782ba99e412efe79e0ccacfbe9bc
Created August 9, 2023 10:20
CSV of US economic indicators, from Wikipedia
Year GDP (in Bil. US$PPP) GDP per capita (in US$ PPP) GDP (in Bil. US$nominal) GDP per capita (in US$ nominal) GDP growth (real) Inflation rate (in Percent) Unemployment (in Percent) Government debt (in % of GDP)
1980 2857.3 12552.9 2857.3 12552.9 -0.3% 13.5% 7.2%
1981 3207.0 13948.7 3207.0 13948.7 2.5% 10.4% 7.6%
1982 3343.8 14405.0 3343.8 14405.0 -1.8% 6.2% 9.7%
1983 3634.0 15513.7 3634.0 15513.7 4.6% 3.2% 9.6%
1984 4037.7 17086.4 4037.7 17086.4 7.2% 4.4% 7.5%
1985 4339.0 18199.3 4339.0 18199.3 4.2% 3.5% 7.2%
1986 4579.6 19034.8 4579.6 19034.8 3.5% 1.9% 7.0%
1987 4855.3 20001.0 4855.3 20001.0 3.5% 3.6% 6.2%
1988 5236.4 21376.0 5236.4 21376.0 4.2% 4.1% 5.5%
Date,Open,High,Low,Close,Adj Close,Volume
2018-06-22,46.529999,46.537498,46.174999,46.230000,44.180878,108801600
2018-06-25,45.849998,46.230000,45.182499,45.542500,43.523846,126652400
2018-06-26,45.747501,46.632500,45.634998,46.107498,44.063797,98276800
2018-06-27,46.307499,46.820000,46.007500,46.040001,43.999287,101141200
2018-06-28,46.025002,46.552502,45.950001,46.375000,44.319439,69460800
2018-06-29,46.572498,46.797501,45.727501,46.277500,44.226257,90950800
2018-07-02,45.955002,46.825001,45.855000,46.794998,44.720829,70925200
2018-07-03,46.947498,46.987499,45.884998,45.980000,43.941952,55819200
2018-07-05,46.314999,46.602501,46.070000,46.349998,44.295551,66416800
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
1
1
1
1
1
1
1
4
1
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
1.63
0.46
0.87
2.13
1.4
1.4
1.8
11.9
1.27
0.6
@reuven
reuven / setup-course.py
Created April 19, 2021 16:07
The script I use to set up a new course, along with a synchronized repo on GitHub for use with "gitautopush"
#!/usr/bin/env python3
import argparse
import shutil
import os
from github import Github
github_token = open('/Users/reuven/.github_token').read().strip()
parser = argparse.ArgumentParser()
a=1
b=2
c=3
d=/etc/passwd
157.55.39.22 - - [14/Apr/2019:06:29:05 +0000] "GET /robots.txt HTTP/1.1" 301 4317 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
157.55.39.229 - - [14/Apr/2019:06:29:12 +0000] "GET / HTTP/1.1" 301 4317 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
198.20.99.130 - - [14/Apr/2019:06:29:29 +0000] "GET / HTTP/1.1" 200 4264 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36"
198.20.99.130 - - [14/Apr/2019:06:29:31 +0000] "\n" 400 3511 "-" "-"
198.20.99.130 - - [14/Apr/2019:06:29:32 +0000] "\n" 400 3527 "-" "-"
198.20.99.130 - - [14/Apr/2019:06:29:32 +0000] "\n" 400 3505 "-" "-"
198.20.99.130 - - [14/Apr/2019:06:29:32 +0000] "\n" 400 3505 "-" "-"
198.20.99.130 - - [14/Apr/2019:06:29:33 +0000] "\n" 400 3505 "-" "-"
198.20.99.130 - - [14/Apr/2019:06:29:36 +0000] "quit\n" 400 3321 "-" "-"
198.20.99.130 - - [14/Apr/2019:06:29:36 +0000] "GET /robots.txt HTTP/1.1" 404 4013 "-" "-"
Date Open High Low Close Adj Close Volume
2018-04-09 169.880005 173.089996 169.850006 170.050003 170.050003 29017700
2018-04-10 173.000000 174.000000 171.529999 173.250000 173.250000 28408600
2018-04-11 172.229996 173.919998 171.699997 172.440002 172.440002 22431600
2018-04-12 173.410004 175.000000 173.039993 174.139999 174.139999 22889300
2018-04-13 174.779999 175.839996 173.850006 174.729996 174.729996 25124300
2018-04-16 175.029999 176.190002 174.830002 175.820007 175.820007 21578400
2018-04-17 176.490005 178.940002 176.410004 178.240005 178.240005 26605400
2018-04-18 177.809998 178.820007 176.880005 177.839996 177.839996 20754500
2018-04-19 173.759995 175.389999 172.660004 172.800003 172.800003 34808800
@reuven
reuven / CSCO.csv
Created January 22, 2018 16:05
Cisco stock prices, in CSV format
Date Open High Low Close Adj Close Volume
2017-12-22 38.520000 38.740002 38.470001 38.549999 38.264591 11441600
2017-12-26 38.549999 38.680000 38.360001 38.480000 38.195110 8186100
2017-12-27 38.540001 38.650002 38.450001 38.560001 38.274517 10543000
2017-12-28 38.730000 38.730000 38.450001 38.590000 38.304295 8807700
2017-12-29 38.410000 38.619999 38.299999 38.299999 38.016441 12583600
2018-01-02 38.669998 38.950001 38.430000 38.860001 38.572296 20135700
2018-01-03 38.720001 39.279999 38.529999 39.169998 38.879997 29536000
2018-01-04 39.049999 39.540001 38.930000 38.990002 38.990002 20731400
2018-01-05 39.549999 39.880001 39.369999 39.529999 39.529999 24588200
This file has been truncated, but you can view the full file.
A
a
aa
aal
aalii
aam
Aani
aardvark
aardwolf
Aaron