import pandas as pd %load_ext rmagic %%R script_dir = './script' data_dir = './data' raw_dir = paste(data_dir, '/raw', sep='') cleaned_dir = paste(data_dir, '/cleaned', sep='') simulated_dir = paste(data_dir, '/simulated', sep='') visualizations_dir = './visualizations' dir.create(script_dir) dir.create(data_dir) dir.create(raw_dir) dir.create(cleaned_dir) dir.create(simulated_dir) dir.create(visualizations_dir) !ls print "Data Folder: " !ls data/ %%R immigration_url = 'https://dl.dropboxusercontent.com/u/40198639/stats_data/immg.csv' blackunemployment_url = 'https://dl.dropboxusercontent.com/u/40198639/stats_data/black.csv' whiteunemployment_url = 'https://dl.dropboxusercontent.com/u/40198639/stats_data/white.csv' highedu_url = 'https://dl.dropboxusercontent.com/u/40198639/stats_data/high_edu.csv' lowedu_url = 'https://dl.dropboxusercontent.com/u/40198639/stats_data/low_edu.csv' unemployment_url = 'https://dl.dropboxusercontent.com/u/40198639/stats_data/un_rate.csv' %%R date = paste(strsplit(date(), split=' ')[[1]], collapse='_') immigration_file = './data/raw/immg.csv' blackunemployment_file = './data/raw/black.csv' whiteunemployment_file = './data/raw/white.csv' highedu_file = './data/raw/high_edu.csv' lowedu_file = './data/raw/low_edu.csv' unemployment_file = './data/raw/un_rate.csv' %%R download.file(immigration_url, immigration_file, method="curl") download.file(blackunemployment_url, blackunemployment_file, method="curl") download.file(whiteunemployment_url, whiteunemployment_file, method="curl") download.file(highedu_url, highedu_file, method="curl") download.file(lowedu_url, lowedu_file, method="curl") download.file(unemployment_url, unemployment_file, method="curl") print(list.files(raw_dir)) import pandas as pd immg = pd.read_csv("./data/raw/immg.csv", header = 0) black = pd.read_csv("./data/raw/black.csv", header = 0) white = pd.read_csv("./data/raw/white.csv", header = 0) high_edu = pd.read_csv("./data/raw/high_edu.csv", header = 0) low_edu = pd.read_csv("./data/raw/low_edu.csv", header = 0) un_rate = pd.read_csv("./data/raw/un_rate.csv", header = 0) immg.head() Display the sample of un_rate.csv file un_rate.head() black.head() white.head() high_edu.head() low_edu.head()