Skip to content

Instantly share code, notes, and snippets.

View rdpharr's full-sized avatar
😺
there's a cat on my keyboard

Roger Pharr rdpharr

😺
there's a cat on my keyboard
View GitHub Profile
@rdpharr
rdpharr / s3_directory_listing.html
Created September 1, 2021 23:44
HTML to list public s3 bucket contents in datatable
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>S3 Bucket Files</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/jq-3.3.1/dt-1.11.0/datatables.min.css"/>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/jq-3.3.1/dt-1.11.0/datatables.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/SummersRemote/xmlToJSON/lib/xmlToJSON.js"></script>
</head>
<body>
@rdpharr
rdpharr / backtest_mlb.ipynb
Created August 2, 2019 02:16
MLB 30-day Backtest Notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rdpharr
rdpharr / downcast.py
Created December 25, 2018 21:34
downcast pandas dataframe
def downcast(df):
float_cols = [x for x in df.columns if df[x].dtype=='float64']
for f in float_cols:
df[f] = pd.to_numeric(df[f], downcast='float')
int_cols = [x for x in df.columns if df[x].dtype=='int64']
for f in int_cols:
df[f] = pd.to_numeric(df[f], downcast='integer')
print(df.dtypes)
return df