Read in the gold prices from the file ounce of gold is listed in US dollars...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Read in the gold prices from the file ounce of gold is listed in US dollars from January 1950-July 2020. [ ] import pandas as pd [] #get the data df df pd.read_csv(...) https://sueuland.greenriverdev.com/SDEV121/modules/gold.csv where the average monthly price of an + Code Text by-s - Task 2 Run the cell below, and examine the data by answering these questions. [ ] 1. Are there any missing values in the Gold DataFrame? How do you know? 2. Does the Date column contain datetime objects? If not, ensure the Date column contains datetime objects. [] # examine the data [ ] #if needed, convert the Date column entries to datetime objects Task 3 Plot the data with a line plot. You should see a graph similar to what is shown below, but you may use any plotting library. Price 1750 1500 1250 1000 750 500 250 0 1959 1969 1979 1989 1999 2009 2019 Date [] #add your code here - Task 4 Add a column named Year and Quarter that holds the respective year and quarter from the Date field of the Pandas DataFrame. [ ] import datetime as dt #add your code here Task 5 Group the DataFrame by Year and calculate the gold's average price for that year and assign the result to a Pandas Series named avg_prices. When avg_prices is displayed, you should see the following output. Year 1950 34.729167 1951 34.717500 1952 34.628333 1953 34.879167 1954 35.020000 2016 1248.161833 2017 1257.848583 2018 1269.852583 2019 1392.585750 1674.830857 2020 Name: Price, Length: 71, dtype: float64 [ ] #add your code here avg_prices = ... avg_prices Task 6 Create a line plot using the years and average gold prices in avg_prices to create a graph similar to what is shown below: Gold Prices s Cost Per Ounce 1750 1500 1250 1000 750 500 250 1950 1960 1970 1980 1990 2000 2010 2020 Year [ ] #add your code here Read in the gold prices from the file ounce of gold is listed in US dollars from January 1950-July 2020. [ ] import pandas as pd [] #get the data df df pd.read_csv(...) https://sueuland.greenriverdev.com/SDEV121/modules/gold.csv where the average monthly price of an + Code Text by-s - Task 2 Run the cell below, and examine the data by answering these questions. [ ] 1. Are there any missing values in the Gold DataFrame? How do you know? 2. Does the Date column contain datetime objects? If not, ensure the Date column contains datetime objects. [] # examine the data [ ] #if needed, convert the Date column entries to datetime objects Task 3 Plot the data with a line plot. You should see a graph similar to what is shown below, but you may use any plotting library. Price 1750 1500 1250 1000 750 500 250 0 1959 1969 1979 1989 1999 2009 2019 Date [] #add your code here - Task 4 Add a column named Year and Quarter that holds the respective year and quarter from the Date field of the Pandas DataFrame. [ ] import datetime as dt #add your code here Task 5 Group the DataFrame by Year and calculate the gold's average price for that year and assign the result to a Pandas Series named avg_prices. When avg_prices is displayed, you should see the following output. Year 1950 34.729167 1951 34.717500 1952 34.628333 1953 34.879167 1954 35.020000 2016 1248.161833 2017 1257.848583 2018 1269.852583 2019 1392.585750 1674.830857 2020 Name: Price, Length: 71, dtype: float64 [ ] #add your code here avg_prices = ... avg_prices Task 6 Create a line plot using the years and average gold prices in avg_prices to create a graph similar to what is shown below: Gold Prices s Cost Per Ounce 1750 1500 1250 1000 750 500 250 1950 1960 1970 1980 1990 2000 2010 2020 Year [ ] #add your code here
Expert 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 operating system questions
-
List 2 companies that are a great example of market penetration? Why?
-
Control Theory allows us to find various useful properties of a system such as stability. Draw a picture of a generic control system, explaining the functions of feedback and the design goals for the...
-
To save for her newborn son's college education, Lea Wilson will invest $1,000 at the beginning of each year for the next 18 years. The interest rate is 12 percent. What is the future value? 1)...
-
Many companies use long-term leases to finance long-term assets. Although these leases are similar to mortgage payments, they are structured in such a way that they qualify as operating leases. As a...
-
a. ToLower("N") b. Length_Of(ToLower(Name)), where Name is a String variable and Name = "Nancy Newley" Give the value returned by the built-in function.
-
Plaintiffs W. O. and J. C. Lucy had wanted to purchase Ferguson Farm from the Zehmers for at least eight years. One night, Lucy stopped by the establishment the Zehmers operated and said that he bet...
-
Paul Sabin organized Sabin Electronics 10 years ago to produce and sell several electronic devices on which he had secured patents. Although the company has been fairly profitable, it is now...
-
1. We define the product of operators by composition. That is, AB|4) = A(B|4)). Show that, for the two-level atom, the evolution operator satisfies U(t) U(ts)U(s).
-
the primary difference between the aggregate demand curve and anindividual demand curve is that: a. The aggregate demand curve represents total plannedexpenditures on all goods and services while an...
-
Since 2010, the U.S. dollar has appreciated relative to the Mexican peso. What are the direct and indirect effects on inflation? Explain.
-
CPI in the United States was 255.7 in 2019 and 258.8 in 2020. What was the inflation rate in 2020?
-
Think about constructing a CPI for students. What do you think belongs in the basket of goods and services for the average student? Do you think that the value of this basket over time has likely...
-
For each scenario, determine which function of money is being described. a. Robert pays $8.00 to cross the Golden Gate Bridge. b. Liza considers which is the better deal: a desk lamp priced at...
-
What indicators should you use to track each of the following, and why? a. The overall size of the economy b. Labor market performance c. The future trajectory of economic activity d. Wages and...
-
A patient is admitted to the hospital with a diagnosis of diarrhea with dehydration. The nurse recognizes that increased peristalsis resulting in diarrhea can be related to a. sympathetic inhibition....
-
During registration at Tech every quarter, students in the Department of Management must have their courses approved by the departmental advisor. It takes the advisor an average of 4 minutes...
-
Jason and Mary Wells, friends of yours, were married on December 30, 2012. They know you are studying taxes and have come to you with a question concerning their filing status. Jason and Mary would...
-
Ann hires a nanny to watch her two children while she works at a local hospital. She pays the 19-year-old nanny $125 per week for 48 weeks during the current year. a. What is the employer's portion...
-
Larry and Lisa Williams, both 33 years old, have been married for 9 years. They live at 638 Arctic Way, Fairbanks, AK 99701. Lisa's Social Security number is 445- 81-1423 and Larry's is 798-09-8526....
-
Suppose that the universe of available risky securities consists of a large number of stocks, identically distributed with E(r) = 15%, = 60%, and a common correlation coefficient of = .5. a. What...
-
Suppose that two portfolio managers who work for competing investment management houses each employs a group of security analysts to prepare the input list for the Markowitz algorithm. When all is...
-
What is the Sharpe ratio of the best feasible CAL?
Study smarter with the SolutionInn App