Question: Problem 5 : Total World - wide Production Need Problem 5 a: So , now that we ve done all that work, how much seafood
Problem : Total Worldwide Production Need
Problem a:
So now that weve done all that work, how much seafood will the entire world need to produce years from now?
For this problem, write a function called totalproductionneeddata yearstopredict that returns a single number: how many metric tonnes will the world need to produce yearstopredict years from now?
This function should do the following:
Take as input the data returned from Problem s parsedata and a number of years in the future to predict.
For each country code, predict the production need for yearstopredict years from now using Problem as predictneed function.
Get the last value in the predicted values.
For example, if you assign the return value from predictneed to prediction, you should be able to get the last value with predictionvalues
Sum up all of the predicted values.
Return the total.
Running your program with small.csv as the input file to parsedata, totalproductionneedshould return a total production need of Your degree of precision may vary.
Problem b: Running with the large file:
At this point, its time to run with the larger data file. Change the call to parsedata to use "large.csv as its input. Then, at the very end of your program, add a print statement to print out the total you return from totalproductionneed. Your program should print the following:
Metric tonnes of seafood needed to be produced in years:
Info
You can format very large numbers using Pythons fstring syntax. For example, if total doing printftotalneed:,f would print
Warning
This final number is a gross approximation and should not be used as a realistic estimate of the worlds total seafood production need.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
