Skip to content

Instantly share code, notes, and snippets.

@ZeccaLehn
ZeccaLehn / SP500.csv
Created October 28, 2019 00:58
S&P500 CSV Tickers
Symbol Name Sector
MMM 3M Company Industrials
AOS A.O. Smith Corp Industrials
ABT Abbott Laboratories Health Care
ABBV AbbVie Inc. Health Care
ACN Accenture plc Information Technology
ATVI Activision Blizzard Information Technology
AYI Acuity Brands Inc Industrials
ADBE Adobe Systems Inc Information Technology
AAP Advance Auto Parts Consumer Discretionary
@ZeccaLehn
ZeccaLehn / pythonzip.py
Created April 5, 2019 17:47
Read Zip into Python from URL
import requests, zipfile, io
url = 'https://www.huduser.gov/portal/datasets/hads/hads2013n_ASCII.zip'
filename = 'thads2013n.txt'
r = requests.get(url)
z = zipfile.ZipFile(io.BytesIO(r.content))
z.extractall()
import pandas as pd
@ZeccaLehn
ZeccaLehn / AnacondaSpark.py
Last active December 20, 2023 07:44
Install Anaconda and Spark
######################## Linux #############################
### Auto Install Anaconda in Linux
mkdir Downloads
cd Downloads
wget "https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh" -O "Anaconda3-5.0.1-Linux-x86_64.sh"
chmod +x Anaconda3-5.0.1-Linux-x86_64.sh
sudo sh "Anaconda3-5.0.1-Linux-x86_64.sh" -b
cd $HOME
rm -r Downloads
@ZeccaLehn
ZeccaLehn / pythonActualPrice.ipynb
Last active July 10, 2023 10:10
Py: Adjust Splits and Dividends from Real Prices using Quandl Finance Data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ZeccaLehn
ZeccaLehn / RTencrypt.txt
Created July 9, 2023 06:38
Round Trip Encryption w/Python
pip install cryptography
-----------------
from cryptography.fernet import Fernet
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
import base64
import os
@ZeccaLehn
ZeccaLehn / mtcars.csv
Last active July 7, 2023 05:53
Python Download CSV from Gist (MTCARS DataSet)
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21 6 160 110 3.9 2.62 16.46 0 1 4 4
Mazda RX4 Wag 21 6 160 110 3.9 2.875 17.02 0 1 4 4
Datsun 710 22.8 4 108 93 3.85 2.32 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360 175 3.15 3.44 17.02 0 0 3 2
Valiant 18.1 6 225 105 2.76 3.46 20.22 1 0 3 1
Duster 360 14.3 8 360 245 3.21 3.57 15.84 0 0 3 4
Merc 240D 24.4 4 146.7 62 3.69 3.19 20 1 0 4 2
Merc 230 22.8 4 140.8 95 3.92 3.15 22.9 1 0 4 2
@ZeccaLehn
ZeccaLehn / multipleStocks.py
Last active June 22, 2023 23:31
Download multiple stocks with Python Pandas
# Clone and pip install pandas_datareader from Github first
# pip install fix_yahoo_finance --upgrade --no-cache-dir
# conda install -c https://conda.anaconda.org/anaconda pandas-datareader
import pandas as pd
pd.core.common.is_list_like = pd.api.types.is_list_like
from pandas.api.types import is_list_like
from pandas_datareader import data as pdr
import fix_yahoo_finance as yf
@ZeccaLehn
ZeccaLehn / gistExplore.ipynb
Last active January 11, 2023 14:32
Blog: Level-Up using Gists with Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ZeccaLehn
ZeccaLehn / microVC.csv
Created October 6, 2019 21:06
Micro VC CSV
Firm Name Investment Sector Location (City) Investment Stage URL
1776 Technology, Health, Transportation, Energy, Education Washington, D.C. Early Stage Venture, Seed https://www.1776.vc/
11.2 Capital Healthcare, Security, Finance San Francisco, CA Early Stage, Seed http://www.112capital.com/
122 West Ventures Information Technology, Telecoms, Media, and Communications San Francisco, CA Early Stage 122west.vc/
1517 Fund Clean Technology, Consumer Discretionary, Healthcare, Industrials, Information Technology, Telecoms, Media, and Communications San Francisco, CA Early Stage: Seed, Early Stage: Start-up www.1517fund.com
1confirmation Financial Services San Francisco, CA Early Stage Venture, Seed www.1confirmation.com
3Rodeo Business Services, Information Technology, Telecoms, Media, and Communications Los Angeles, CA Early Stage, Early Stage: Seed www.3rodeo.com
4490 Ventures Technology, Financial Services, Agriculture, Education Madison, WI Early Stage Venture, Seed http:
@ZeccaLehn
ZeccaLehn / ExploreHiddenR.md
Last active December 1, 2020 15:23
[R] Explore Hidden Environments and Functions -- by example

Shows function Internals

library(BayesianFirstAid)
debugonce(bayes.t.test) # turns off debugging for function after first run
bayes.t.test(co2)

Returns hidden and unhidden environments