This works only on Unix.
- Get youtube-dl
- List the formats for the video with
youtube-dl --list-formats <url>
You'll get an output like
[youtube] h3--ed9sOQo: Downloading webpage
[youtube] h3--ed9sOQo: Downloading m3u8 information
# Compute transition matrix based on a distribution | |
using LinearAlgebra, Distributions | |
function fTransitionMatrix(grid; dist = LogNormal()) | |
N = size(grid)[1] | |
Mat = UpperTriangular(transpose(repeat(grid, outer=[1, N])) .- grid) | |
prMat = cdf.(dist, Mat) | |
trMat = hcat(prMat[:, 2:end], ones(N)) .- prMat | |
end |
This works only on Unix.
youtube-dl --list-formats <url>
You'll get an output like
[youtube] h3--ed9sOQo: Downloading webpage
[youtube] h3--ed9sOQo: Downloading m3u8 information
year | cpi_percent | |
---|---|---|
2020 | 3.32 | |
2019 | 2.56 | |
2018 | 2.43 | |
2017 | 2.19 | |
2016 | 3.8 | |
2015 | 4.35 | |
2014 | 4.39 | |
2013 | 1.93 | |
2012 | 3.02 |
#!/usr/local/bin/python3 | |
import requests | |
import bs4 | |
import csv | |
# Setup | |
url = 'http://www.cmfchile.cl/portal/principal/605/w3-article-25080.html' | |
headers = { | |
'Host': 'www.svs.cl', | |
'Connection': 'keep-alive', |
using Random, Distributions | |
using ProgressMeter | |
using LaTeXTabulars, LaTeXStrings | |
Random.seed!(0303) | |
""" | |
Generate `M` simulation draws for `k` parameters for a design given by `θfactor` | |
Inputs: | |
- θfactor ... scalar with factor for θ_i (the "design") |
setwd("/Users/alvaro/Dropbox/Princeton/2021-Spring/539B/03-IV/hw03") | |
### Load libraries | |
library(tidyverse) | |
library(haven) # import .dta | |
library(sandwich) # vcovHC() | |
library(clubSandwich) # vcovCR() | |
library(dfadjust) | |
library(progress) | |
library(brew) |
--- | |
title: "ECO313 - PS03" | |
author: "Álvaro Carril" | |
output: | |
pdf_document: default | |
html_document: | |
df_print: paged | |
--- | |
This is my take on problem set 3, in R, for those who are curious about trying a ~~better~~ different tool. |
# ECO313 - Problem Set Solutions |
Lots of people (myself included) have been confused about how to go about installing Python on a new (or old) machine. This document is an attempt to maintain an up-to-date, succint guide on how to properly set up Python on macOS. It's 2021, so we'll focus on Python 3 here ffs.
The process is simple. Broadly speaking, my method boils down to
pyenv
using Homebrew, andpyenv
Yes, there are many more ways of doing this. Here we'll focus on my way, which is nevertheless based on careful testing and assesment of pros and cons of each method. See here or here for more details on available alternatives.