This file contains hidden or 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
| function lmito(income, initial_value = 200, increased_value = 530, | |
| taper_one_start = 37000, taper_two_start = 90000, taper_in_rate = 0.03, | |
| taper_out_rate = 0.015) { | |
| if (income < taper_one_start) { | |
| return initial_value * -1; | |
| } | |
| else if (income >= taper_one_start & income <= taper_two_start) { | |
| let tapered_in_lmito = (initial_value + (income - taper_one_start) * taper_in_rate); | |
| if (tapered_in_lmito < increased_value) { | |
| return tapered_in_lmito * -1; |
This file contains hidden or 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
| #!/usr/local/bin/python3 | |
| import pandas as pd | |
| import glob | |
| import os | |
| import sys | |
| input_path = sys.argv[1] | |
| output_file = sys.argv[2] | |
| all_workbooks = glob.glob(os.path.join(input_path,'*.xls*')) | |
| df_names = [] | |
| for i in all_workbooks: |
This file contains hidden or 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
| medicare_levy <- function(income, rate = .02, taper_threshold_lower = 21335, taper_threshold_upper = 26668) { | |
| if (income < taper_threshold_lower) { | |
| # People earning below the low income threshold pay no tax | |
| return(0) | |
| } else if (income >= taper_threshold_lower & income <= taper_threshold_upper) { | |
| # People earning income that is between the taper thresholds pay 10 cents for each dollar over the low income threshold | |
| return((income - taper_threshold_lower) * .1) | |
| } else { | |
| # People above the upper taper threshold pay the standard medicare levy | |
| return(income * rate) |
This file contains hidden or 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
| medicare_levy <- function(income, rate) { | |
| income * rate | |
| } |
This file contains hidden or 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
| install.packages(c('devtools', 'tidyverse')) | |
| devtools::install_github('thmcmahon/ozTaxData') |
This file contains hidden or 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
| medicare_levy <- function(income) { | |
| income * .02 | |
| } |
This file contains hidden or 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
| library(zoo) | |
| path <- "~/Desktop/Total Deaths - Assault - All Ages _ tom.csv" | |
| df <- read.csv(path, na.strings = "...", skip = 1) | |
| # transpose the dataframe (flip it) | |
| df <- setNames(data.frame(t(df[,-1])), df[,1]) | |
| # This just makes the names prettier | |
| names(df) <- gsub("^ ", "", gsub("\\d", "", names(df))) | |
| # Falkland Islands only has one value so there's nothing to interpolate | |
| # so we'll set them all to 0 |
This file contains hidden or 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
| library(dplyr) | |
| data(iris) | |
| str(iris['Sepal.Length']) | |
| 'data.frame': 150 obs. of 1 variable: | |
| $ Sepal.Length: num 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ... | |
| str(iris[,'Sepal.Length']) | |
| num [1:150] 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ... |
This file contains hidden or 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
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><link rel="shortcut icon" href="https://ssl.gstatic.com/docs/spreadsheets/forms/favicon_jfk2.png" type="image/x-icon"> | |
| <meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=10; chrome=1;"> | |
| <meta name="fragment" content="!"> | |
| <base target="_blank"> | |
| <link rel="stylesheet" type="text/css" href=""> | |
| <link href='/static/forms/client/css/3377844631-formview_embedded_ltr.css' type='text/css' rel='stylesheet'> | |
| <style type="text/css"> |