Perform all computations in the script below. Only display the output requested below (suppress display of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Perform all computations in the script below. Only display the output requested below (suppress display of all other computations). Consider the data file, DFWtemps.dat (Even though you can't see this file, it is already placed in the same folder as the the script which you will write below, so that your script can access this file.) This file contains a matrix with 13 columns. The first column contains the numbers 2022 at the top, down to 1973 at the bottom (the years temperature data was recorded by the National Weather Service). The second column contains the average temperatures (Fahrenheit) officially recorded in Dallas-Fort Worth for the month of January, starting at Jan 2022 at the top, down to Jan 1973 at the bottom: the third column contains average temperatures for Feb 2022 down to Feb 1973, and so forth. In other words, Jan Feb Mar Apr May Jun Jul Aug Sept Oct Nov Dec 2022 45.8 46.2 58.5 69.5 77.9 86.1 91.8 86.8 80.6 69.1 55 50.7 2021 47.5 41.1 61.4 64.6 71.8 82.1 84.7 85.1 80.5 72 57.7 61.3 1973 42.5 47.9 60 60.7 71.7 79.3 83.9 82.9 76.1 68.3 59.8 48.4 1) Load this data file directly into one matrix, with the same name as the file. 2) Next, make three column vectors from this matrix: a) one column vector, called Y, will contain the years, starting with 2022 as the first element, going down to 1973 for the last element. b) another column vector, called WinAve, will contain the average of the January and February temperatures; i.e., the first element will contain the Jan-Feb average for 2022, the second element the Jan-Feb average for 2021, and so forth, down to the Jan-Feb average for 1973. (Use array/scalar operators, rather than a loop.) c) a third column vector, called SumAve, will contain the average of the June, July and Aug. temperatures; ie, the first element will contain the June-July-Aug average for 2022, the second element the June-July-Aug average for 2021, and so forth, down to the June-July-Aug average for 1973. (Use array/scalar operators, rather than a loop.) 3) Now convert the temperature vectors to degrees C: a) convert WinAve into a column vector of corresponding temperatures in degrees C, and assign this vector to WinAvec (Use array/scalar operators). b) likewise, convert SumAve to degrees C, and assign to vector SumAvec (Use array/scalar operators). 4) Now reverse the order of the 3 vectors, Y, WinAveC, and SumAveC, reassigning the results to variables, YF, Win AveCF, and SumAveCF, respectively. 4) Output a plot that has the following features on the same plot: - a graph of Y vs WinAveC, where each point is connected by a solid line - a graph of Y vs SumAveC, where each point is also connected by a solid line - in addition, each point on the WinAvec graph is marked by an x - in addition, each point on the SumAvec graph is marked by a circle. - the x-axis is labeled "Year" - the y-axis is labeled "DFW Ave Temps" - a legend that labels the WinAvec grapha Moter Auerngel Ausal ph as "Summer Average" 2022 45.8 46.2 58.5 69.5 77.9 86.1 91.8 86.8 80.6 69.1 55 50.7 2021 47.5 41.1 61.4 64.6 71.8 82.1 84.7 85.1 80.5 72 57.7 61.3 1973 42.5 47.9 60 60.7 71.7 79.3 83.9 82.9 76.1 68.3 59.8 48.4 1) Load this data file directly into one matrix, with the same name as the file. 2) Next, make three column vectors from this matrix: a) one column vector, called Y, will contain the years, starting with 2022 as the first element, going down to 1973 for the last element. b) another column vector, called WinAve, will contain the average of the January and February temperatures; i.e., the first element will contain the Jan-Feb average for 2022, the second element the Jan-Feb average for 2021, and so forth, down to the Jan-Feb average for 1973. (Use array/scalar operators, rather than a loop.) c) a third column vector, called SumAve, will contain the average of the June, July and Aug. temperatures; i.e., the first element will contain the June-July-Aug average for 2022, the second element the June-July-Aug average for 2021, and so forth, down to the June-July-Aug average for 1973. (Use array/scalar operators, rather than a loop.) 3) Now convert the temperature vectors to degrees C: a) convert WinAve into a column vector of corresponding temperatures in degrees C, and assign this vector to WinAvec (Use array/scalar operators). b) likewise, convert SumAve to degrees C. and assign to vector SumAvec (Use array/scalar operators). 4) Now reverse the order of the 3 vectors, Y, WinAveC, and SumAveC, reassigning the results to variables, YF, WinAveCF, and SumAveCF, respectively. 4) Output a plot that has the following features on the same plot: - a graph of Y vs WinAveC, where each point is connected by a solid line - a graph of Y vs SumAveC, where each point is also connected by a solid line - in addition, each point on the WinAvec graph is marked by an x - in addition, each point on the SumAvec graph is marked by a circle. - the x-axis is labeled "Year" - the y-axis is labeled "DFW Ave Temps" a le a legend that labels the WinAvec graph as "Winter Average and the SumAvec graph as "Summer Average" - a grid is overlaid on the entire plot -the domain of the x-axis is [1973,2022]; the range of the y-axis is [0,40] Perform all computations in the script below. Only display the output requested below (suppress display of all other computations). Consider the data file, DFWtemps.dat (Even though you can't see this file, it is already placed in the same folder as the the script which you will write below, so that your script can access this file.) This file contains a matrix with 13 columns. The first column contains the numbers 2022 at the top, down to 1973 at the bottom (the years temperature data was recorded by the National Weather Service). The second column contains the average temperatures (Fahrenheit) officially recorded in Dallas-Fort Worth for the month of January, starting at Jan 2022 at the top, down to Jan 1973 at the bottom: the third column contains average temperatures for Feb 2022 down to Feb 1973, and so forth. In other words, Jan Feb Mar Apr May Jun Jul Aug Sept Oct Nov Dec 2022 45.8 46.2 58.5 69.5 77.9 86.1 91.8 86.8 80.6 69.1 55 50.7 2021 47.5 41.1 61.4 64.6 71.8 82.1 84.7 85.1 80.5 72 57.7 61.3 1973 42.5 47.9 60 60.7 71.7 79.3 83.9 82.9 76.1 68.3 59.8 48.4 1) Load this data file directly into one matrix, with the same name as the file. 2) Next, make three column vectors from this matrix: a) one column vector, called Y, will contain the years, starting with 2022 as the first element, going down to 1973 for the last element. b) another column vector, called WinAve, will contain the average of the January and February temperatures; i.e., the first element will contain the Jan-Feb average for 2022, the second element the Jan-Feb average for 2021, and so forth, down to the Jan-Feb average for 1973. (Use array/scalar operators, rather than a loop.) c) a third column vector, called SumAve, will contain the average of the June, July and Aug. temperatures; ie, the first element will contain the June-July-Aug average for 2022, the second element the June-July-Aug average for 2021, and so forth, down to the June-July-Aug average for 1973. (Use array/scalar operators, rather than a loop.) 3) Now convert the temperature vectors to degrees C: a) convert WinAve into a column vector of corresponding temperatures in degrees C, and assign this vector to WinAvec (Use array/scalar operators). b) likewise, convert SumAve to degrees C, and assign to vector SumAvec (Use array/scalar operators). 4) Now reverse the order of the 3 vectors, Y, WinAveC, and SumAveC, reassigning the results to variables, YF, Win AveCF, and SumAveCF, respectively. 4) Output a plot that has the following features on the same plot: - a graph of Y vs WinAveC, where each point is connected by a solid line - a graph of Y vs SumAveC, where each point is also connected by a solid line - in addition, each point on the WinAvec graph is marked by an x - in addition, each point on the SumAvec graph is marked by a circle. - the x-axis is labeled "Year" - the y-axis is labeled "DFW Ave Temps" - a legend that labels the WinAvec grapha Moter Auerngel Ausal ph as "Summer Average" 2022 45.8 46.2 58.5 69.5 77.9 86.1 91.8 86.8 80.6 69.1 55 50.7 2021 47.5 41.1 61.4 64.6 71.8 82.1 84.7 85.1 80.5 72 57.7 61.3 1973 42.5 47.9 60 60.7 71.7 79.3 83.9 82.9 76.1 68.3 59.8 48.4 1) Load this data file directly into one matrix, with the same name as the file. 2) Next, make three column vectors from this matrix: a) one column vector, called Y, will contain the years, starting with 2022 as the first element, going down to 1973 for the last element. b) another column vector, called WinAve, will contain the average of the January and February temperatures; i.e., the first element will contain the Jan-Feb average for 2022, the second element the Jan-Feb average for 2021, and so forth, down to the Jan-Feb average for 1973. (Use array/scalar operators, rather than a loop.) c) a third column vector, called SumAve, will contain the average of the June, July and Aug. temperatures; i.e., the first element will contain the June-July-Aug average for 2022, the second element the June-July-Aug average for 2021, and so forth, down to the June-July-Aug average for 1973. (Use array/scalar operators, rather than a loop.) 3) Now convert the temperature vectors to degrees C: a) convert WinAve into a column vector of corresponding temperatures in degrees C, and assign this vector to WinAvec (Use array/scalar operators). b) likewise, convert SumAve to degrees C. and assign to vector SumAvec (Use array/scalar operators). 4) Now reverse the order of the 3 vectors, Y, WinAveC, and SumAveC, reassigning the results to variables, YF, WinAveCF, and SumAveCF, respectively. 4) Output a plot that has the following features on the same plot: - a graph of Y vs WinAveC, where each point is connected by a solid line - a graph of Y vs SumAveC, where each point is also connected by a solid line - in addition, each point on the WinAvec graph is marked by an x - in addition, each point on the SumAvec graph is marked by a circle. - the x-axis is labeled "Year" - the y-axis is labeled "DFW Ave Temps" a le a legend that labels the WinAvec graph as "Winter Average and the SumAvec graph as "Summer Average" - a grid is overlaid on the entire plot -the domain of the x-axis is [1973,2022]; the range of the y-axis is [0,40]
Expert Answer:
Answer rating: 100% (QA)
Below is a Python script that performs the computations described import numpy as np import ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
7. Ferris Company's beginning inventory balance and transactions for January are as follows: Purchases Sales Date Jan. 01 (balance) Units Unit Cost Date Units 8,000 $ 8.00 Jan. 05 4,000 Jan. 10 Jan....
-
If the GST rate increased from 5 percent to 6 percent.How would you modify the data file so that the correct amounts were charged for sales and purchases? Do you need to change the tax settings for...
-
As a market risk analyst, each day you calculate VaR from the available prior data. Then, you wait ten days to compare your prediction value VaRt-10 to the realised return and check if the prediction...
-
Rewrite these sentences to eliminate buzzwords and figures of speech. A. Also, through SCMC and by also gaining a membership in ISM, certification opportunities will be at your fingertips. B. The...
-
Harry's Hamburgers Ltd. (HHL) is a chain of fast-food restaurants. A few years ago, the company decided it didn't want to own any new restaurants. Rather, when a new restaurant opened up, it is owned...
-
The equity accounts of Lawrence Group have the following balances on December 31, 2022. Share CapitalOrdinary, 10 par, 200,000 shares issued and outstanding .............. 2,000,000 Share...
-
Why would you also want to check social media sites for information about your own client or witness?
-
City Publishing was recently organized. The company issued common stock to an attorney who provided legal services worth $17,000 to help organize the corporation. City Publishing also issued common...
-
(1 point) Get help entering answers The size, S, of a tumor (in cubic millimeters) is given by S = 2', where t is the number of months since the tumor was discovered. Give units with your answers....
-
Why are static variables referred to as class variables? Describe a situation where you would want to use a static variable in your class?
-
Enhancing Data Management and Proposing Dimensional Modeling for Improved Data Warehouse Architecture in Oil Company. In this case study, your objective is to conduct a comprehensive analysis of the...
-
13. Find the zeros of P(x) = x3 + 5x + 4x + 20
-
A car starts 200 m west of the town square and moves with a constant velocity of 15 m/s toward the east. Draw a d vs. t graph that represents the motion of the car a. Write the equation that...
-
Question 2 : Consider the following network. Suppose all 4 nodes are customers. 6 4 7 5 5 We want to open a DC so as to minimize the longest distance to any customer. Suppose the DC should be located...
-
2. Suppose f is a quadratic polynomial function that has a y-intercept at (0, -3) and roots at x = 2 and x = . (a) Sketch a graph of f. Include the given information. (b) Write an equation for f in...
-
A marketing research company employs a large number of typists to enter data into a computer database. The time taken for new typists to learn the computer system is known to have a Normal...
-
For the vector whose polar components are (Vr = 1, Vθ = 0), compute in polars all components of the second covariant derivative Vα;μ;ν. To find...
-
How much of each of the following prizes or awards is taxable? a. Cheline received a $50,000 gift bag at the Oscars in 2012. b. Jon received a gold watch worth $350 for 25 years of service to his...
-
Rebecca and Walter Bunge have been married for 5 years. They live at 883 Scrub Brush Street, Apt. 52B, Las Vegas, NV 89125. Rebecca is a homemaker and Walt is a high school teacher. Rebecca's Social...
-
Abigail (Abby) Boxer is a single mother working as a civilian accountant for the U.S. Army. Her Social Security number is 676-73-3311 and she lives at 3456 Alamo Way, San Antonio, TX 78249. Helen,...
-
A simple pendulum is set into oscillation from its rest position by giving it an angular velocity of \(1 \mathrm{rad} / \mathrm{s}\). It is found to oscillate with an amplitude of \(0.5...
-
Derive an expression for the natural frequency of the simple pendulum shown in Fig. 1.10. Determine the period of oscillation of a simple pendulum having a mass \(m=5 \mathrm{~kg}\) and a length...
-
One of the blades of an electric fan is removed. The steel shaft \(A B\), on which the blades are mounted, is equivalent to a uniform shaft of diameter \(25 \mathrm{~mm}\) and length \(150...
Study smarter with the SolutionInn App