Created
March 21, 2015 04:55
-
-
Save wwwillchen/817316ac9bc9e324ce7b to your computer and use it in GitHub Desktop.
Compute: Example syntax
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
# Example healthcare data set | |
# Benchmarking the productivity vs cost of doctors | |
# Rules the code must follow: | |
# - Must be valid Python code (don't use existing syntax) | |
# Rules the spreadsheet must follow: | |
# - No formulas; only hard-coded values | |
# Define the variables | |
# Note: assume all data is annualized | |
hoursWorked = <A2:A100> | |
patientVolumes = <B2:B100> | |
salary = <C2:C100> | |
specialty = <D2:D100> | |
# Normalizations | |
providerFTE = hoursWorked / 2080 # 2080 hours is considered 1 FTE | |
normalizedPatientVolumes = patientVolumes / providerFTE # adjust it for part-time workers | |
normalizedSalary = salary / providerFTE | |
# Benchmarking | |
# Fetch benchmarking data from HTTP API | |
# Fictious API parameters: | |
# 1) URL | |
# 2) Output | |
# Returns list | |
benchmarkMean = get('API-string', <E2: E100>) | |
benchmarkStandardDeviation = get('API-string #2', <F2: F100>) | |
# Fictious 'rank' function | |
# Inputs: (mean, deviation, sample) | |
providerRank<G2:G100> = rank(benchmarkMean, benchmarkStandardDeviation, sample) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment