Skip to content

Instantly share code, notes, and snippets.

View apoorvalal's full-sized avatar

Apoorva Lal apoorvalal

View GitHub Profile
@apoorvalal
apoorvalal / install-julia.sh
Last active June 16, 2018 16:46 — forked from adriantorrie/install-julia.sh
Ubuntu 14.04 - Install The Julia Language (julia-lang)
sudo add-apt-repository ppa:staticfloat/juliareleases
sudo apt-get update
sudo apt-cache show julia
sudo apt-get install julia julia-doc -y
julia -E 'Pkg.update()'
julia
@apoorvalal
apoorvalal / count_total_project_code_lines_in_sublime
Last active June 20, 2017 18:29 — forked from Hexodus/count_total_project_code_lines_in_sublime
Count total code lines in project using Sublime texteditor
// find->find in files
// Switch on reg_ex button
// Find:
^(.*)$
// Where:
c:\your_folder\,*.py,*.r,*.sh,*.do,*.md, -*/folder_to_exclude/*
// Then click on the find button
// On the bottom line of your search result you'll find something like:
// 21342 matches in 124 files = your lines of code
library(lfe)
library(stargazer)
set.seed(6152011)
# Number of cities
L <- 1000
# Number of industries
K <- 3
@apoorvalal
apoorvalal / stata_summary.R
Created February 21, 2018 16:20 — forked from leeper/stata_summary.R
Stata-style regression summaries
stata_summary <-
function(
x,
...
) {
# summarize
mod <- x
x <- summary(x)
# find outcome variable
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
```{r}
library(MonetDBLite)
library(RSQLite)
library(DBI)
library(dplyr)
library(microbenchmark)
library(ggplot2)
```
@apoorvalal
apoorvalal / useful_pandas_snippets.py
Created October 12, 2018 17:17 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
# Convert Series datatype to numeric (will error if column has non-numeric values)
# h/t @makmanalp
pd.to_numeric(df['Column Name'])
# Convert Series datatype to numeric, changing non-numeric values to NaN
# h/t @makmanalp for the updated syntax!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.