Skip to content

Instantly share code, notes, and snippets.

View SamLau95's full-sized avatar

Sam Lau SamLau95

View GitHub Profile
resid = pd.DataFrame({
'Predicted weight (kg)': predicted, 'Percent error': resids})
px.scatter(resid, x='Predicted weight (kg)', y='Percent error',
width=350, height=250)
px.histogram(
wiki, x='postproductivity', nbins=50,
labels={'postproductivity': 'Number of actions in 90 days post award'},
width=350, height=250)
px.line(co2, x='DecDate', y='Avg', width=350, height=250,
labels={'DecDate':'Date', 'Avg':'Average monthly CO₂'})
fig = px.histogram(X_train['baseurl'].value_counts(), width=450, height=250,
labels={"value": "Number of articles published at a URL"})
px.scatter(crabs, y='inc', x= 'shell', width=350, height=250,
labels=dict(shell='Dungeness crab shell width (mm)',
inc='Growth (mm)'))
fig = px.scatter(
x=prediction_7var, y=error_7var,
labels=dict(x='Seven-variable prediction for AUM', y='Error'),
width=350, height=250)
def compute_ppsf(df):
return df.assign(
ppsf=df['price'] / df['bsqft'],
log_ppsf=lambda df: np.log10(df['ppsf']))
@SamLau95
SamLau95 / inferential_thinking_urls_10_26_2018.txt
Created October 26, 2018 23:24
inferential_thinking_urls_10/26/2018
/
/chapters/intro
/chapters/01/what-is-data-science
/chapters/01/1/intro
/chapters/01/1/1/computational-tools
/chapters/01/1/2/statistical-techniques
/chapters/01/2/why-data-science
/chapters/01/3/Plotting_the_Classics
/chapters/01/3/1/Literary_Characters
/chapters/01/3/2/Another_Kind_Of_Character
@SamLau95
SamLau95 / fix_student_ownership.sh
Created August 26, 2016 19:06
fix_student_ownership.sh
cd /home
find . -maxdepth 2 -name data8assets -group root
names=
for name in ${names[@]}; do cd $name ; chown -R $name:$name data8assets ; cd .. ; done
@SamLau95
SamLau95 / .bash_aliases
Last active August 29, 2015 14:13
Bash_aliases for Vagrant
### Handy Extract Program
ext () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;