Answered step by step
Verified Expert Solution
Question
1 Approved Answer
EDIT: here's the text file a2q6.txt Prov Pop2013 Physic2013 popu2017 phys2017 NL 527400 1305 528800 1500 PE 145200 260 152000 290 NS 943000 2456 953900
EDIT:
here's the text file
a2q6.txt
Prov Pop2013 Physic2013 popu2017 phys2017
NL 527400 1305 528800 1500
PE 145200 260 152000 290
NS 943000 2456 953900 2516
NB 755700 1729 759700 1765
QB 8151300 19501 8394000 20254
ON 13555800 28965 14193400 29898
MB 1265600 2546 1338100 2861
SK 1104800 2092 1163900 2387
AB 3998000 9149 4286100 9910
BC 4590100 10528 4817200 11612
NT 43800 44 44500 166
Question 2 (13 points): Purpose: To practice Arithmetic with arrays. Degre e of Difficulty: Easy In this question, you will use information from Canada Medical Association (CMA) to analyze Physician- Population ratio across all Canadian provinces from year 2013 to 2017. In year 2013 CMA planned to im- prove this ratio by 5% in every province during next five years. You can find a tabular file a6q2.txt in starter folder on Moodle, with all the information that yourequire for this question. It has 5 columns the provinces abbreviated name, its population in year 2013, the number of physicianseach provincehas in 2013, itspop- ulation in year 2017 and the number of physicians each province has in 2017 (a) Begin by opening and reading the file a6q2.txt into Python. b) To assist with analysis, you will need the data stored inamays. Create five arrays that hold the following information: the province strings, the populations in 2013, number of physicians in 2013, the population in 2017 and the number of physicians in 2017. The arrays should maintain the ordering of the file, so that the data for NL' is first, followed by "PE and so forth. Test this before you move on. c) Calculate the population per physician for 2013 and 2017 both. This is easily done with a numpy array calculation. All these values will be float values at this point, but we need integer values to represent this physician-population ratio. Convert these values to integers by using the method numpy.around O It will return the float rounded to the nearest integer (d) Calculate the rate of improvement in physician-population ratio in each province from 2013 to 2017 IHint Formula to find rate of improvement is: old value-new value)/old value)1001 e) We will now uselogical indexing toanalyse our findings Use a relational expression to create a boolean array, where True indicates that the physician-population ration has been increased by at least 5% and False if it is not (f) Also create a boolean array that checks if the rate of improvement in physician-population ration is equal to or less than zero for each province. Your results should indicate that all of the provinces except Ontario have improved their ratio. (g) Finally. we need to report our findings by printing the information to the console. Display the ratios for both year as well as the rate of improvementas shown below
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started