This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set.seed(1) | |
N <- 800 | |
J <- 80 | |
id_firm = 1:J | |
delta = c(1:J)/J | |
capacity <- c(rep(10, 7*J/8), rep(100, J/8)) | |
enrollment <- rep(0, J) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def halton(prime, N): | |
step = 1; | |
k = 0; | |
x = [0]; | |
while(True): | |
t = len(x); | |
for i in range(1,prime): | |
for j in range(t): | |
x.append(i/(prime**step) + x[j]) | |
k = k + 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This code... | |
# scrapes the Spotify Charts website, | |
# gets the necessary data from the Top 200 list (songs, artists, listen counts, and ranks in each country at each date), and | |
# creates a separate data file for each country for which the data is available. | |
import pandas as pd | |
import os | |
import requests | |
from bs4 import BeautifulSoup as bs |