Skip to content

Instantly share code, notes, and snippets.

View chendaniely's full-sized avatar

Daniel Chen chendaniely

View GitHub Profile
@chendaniely
chendaniely / quiz2_review.ipynb
Created June 15, 2022 02:52
DSCI 100 Quiz 2 Code Study Guide
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chendaniely
chendaniely / gitignore
Created June 13, 2022 21:10
dsci 100 .gitignore file
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
@chendaniely
chendaniely / inplace_example.py
Last active January 15, 2022 19:53
Pandas assign inplace example
# tl;dr: you can't assign in place because inplace returns None
import pandas as pd
dat = pd.util.testing.makeMixedDataFrame()
print(dat)
# A B C D
# 0 0.0 0.0 foo1 2009-01-01
# 1 1.0 1.0 foo2 2009-01-02
# 2 2.0 0.0 foo3 2009-01-05
@chendaniely
chendaniely / chained_indexing-base_tidyverse.R
Last active October 15, 2021 16:27
R Copy on write/change example
# base R -----
mycars <- mtcars
mycars
# mpg cyl disp hp drat wt qsec vs am gear carb
# Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4
# Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4
# Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1
# Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1
@chendaniely
chendaniely / index.Rmd
Created January 11, 2021 02:27
backup caption post
---
# Documentation: https://sourcethemes.com/academic/docs/managing-content/
title: "Creating and Adding Subtitles to Your Videos"
subtitle: ""
summary: ""
authors: []
tags: []
categories: []
date: 2020-08-27T19:51:05-05:00
@chendaniely
chendaniely / altair_test.Rmd
Last active December 4, 2020 17:03
Altair in Rmd
---
title: "rmd altair"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(reticulate)
@chendaniely
chendaniely / bined_counts_over_regplot.ipynb
Last active June 11, 2020 17:42
fitted (smooth) line that also shows the distribution of the data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chendaniely
chendaniely / predict_type.md
Created June 19, 2019 01:55
predict type='terms'
title output editor_options
Predict type = 'terms'
html_document
keep_md toc
true
true
chunk_output_type
console
@chendaniely
chendaniely / pandas_replace.ipynb
Last active March 28, 2018 21:26
Pandas replacing values
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chendaniely
chendaniely / pandas_cols_multi_variable.ipynb
Created February 4, 2018 18:43
Columns containing multiple bits of information
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.