The function print_mean() that you wrote in the previous lesson calculates an average value and prints it on the screen. Change this function so that instead of printing the average it returns the average.In order to calculate the sum, you won't need to form a loop; call the function column_sum() instead.
# columns are [0]title [1]year [2]rating [3]length(min) [4]genre
[5]budget($mil) [6]box_office_gross($mil)
oscar_data = [
["The Shape of Water", 2017, 6.914, 123, ['sci-fi', 'drama'], 19.4,
195.243464],
["Moonlight", 2016, 6.151, 110, ['drama'], 1.5, 65.046687],
["Spotlight", 2015, 7.489, 129, ['drama', 'crime', 'history'],
20.0, 88.346473],
["Birdman", 2014, 7.604, 119, ['drama', 'comedy'], 18.0,
103.215094],
["12 Years a Slave", 2013, 7.71, 133, ['drama', 'biography',
'history'], 20.0, 178.371993],
["Argo", 2012, 7.517, 120, ['thriller', 'drama', 'biography'],
44.5, 232.324128],
["The Artist", 2011, 7.942, 96, ['drama', 'melodrama', 'comedy'],
15.0, 133.432856],
["The King\'s Speech", 2010, 7.977, 118, ['drama', 'biography',
'history'], 15.0, 414.211549],
["The Hurt Locker", 2008, 7.298, 126, ['thriller', 'drama', 'war',
'history'], 15.0, 49.230772],
["Slumdog Millionaire", 2008, 7.724, 120, ['drama', 'melodrama'],
15.0, 377.910544],
["No Country for Old Men", 2007, 7.726, 122, ['thriller', 'drama',
'crime'], 25.0, 171.627166],
["The Departed", 2006, 8.456, 151, ['thriller', 'drama', 'crime'],
90.0, 289.847354],
["Crash", 2004, 7.896, 108, ['thriller', 'drama', 'crime'], 6.5,
98.410061],
["Million Dollar Baby", 2004, 8.075, 132, ['drama', 'sport'], 30.0,
216.763646],
["The Lord of the Rings: Return of the King", 2003, 8.617, 201,
['fantasy', 'drama', 'adventure'], 94.0, 1119.110941],
["Chicago", 2002, 7.669, 113, ['musical', 'comedy', 'crime'], 45.0,
306.776732],
['A Beautiful Mind', 2001, 8.557, 135, ['drama', 'biography',
'melodrama'], 58.0, 313.542341],
["Gladiator", 2000, 8.585, 155, ['action', 'drama', 'adventure'],
103.0, 457.640427],
["American Beauty", 1999, 7.965, 122, ['drama'], 15.0,
356.296601],
["Shakespeare in Love", 1998, 7.452, 123, ['drama', 'melodrama',
'comedy', 'history'], 25.0, 289.317794],
["Titanic", 1997, 8.369, 194, ['drama', 'melodrama'], 200.0,
2185.372302],
["The English Patient", 1996, 7.849, 155, ['drama', 'melodrama',
'war'], 27.0, 231.976425],
["Braveheart", 1995, 8.283, 178, ['drama', 'war', 'biography',
'history'], 72.0, 210.409945],
["Forrest Gump", 1994, 8.915, 142, ['drama', 'melodrama'], 55.0,
677.386686],
["Schindler\'s List", 1993, 8.819, 195, ['drama', 'biography',
'history'], 22.0, 321.265768],
["Unforgiven", 1992, 7.858, 131, ['drama', 'western'], 14.4,
159.157447],
["Silence of the Lambs", 1990, 8.335, 114, ['thriller', 'crime',
'mystery', 'drama', 'horror'], 19.0, 272.742922],
["Dances with Wolves", 1990, 8.112, 181, ['drama', 'adventure',
'western'], 22.0, 424.208848],
["Driving Miss Daisy", 1989, 7.645, 99, ['drama'], 7.5,
145.793296],
["Rain Man", 1988, 8.25, 133, ['drama'], 25.0, 354.825435],
]
def column_sum(data, column):
result = 0
for row in data:
result += row[column]
return result
def column_mean(data, column):
# < write code here >
mean_score = column_mean(oscar_data, 2)
print('Average rating: {:.2f}'.format(mean_score))
mean_length = column_mean(oscar_data, 3)
print('Average length: {:.2f} min.'.format(mean_length))
mean_budget = column_mean(oscar_data, 5)
print('Average budget: ${:.2f} mil.'.format(mean_budget))
mean_gross = column_mean(oscar_data, 6)
print('Average revenue: ${:.2f} mil.'.format(mean_gross))
In: Computer Science
# columns are [0]title [1]year [2]rating [3]length(min) [4]genre
[5]budget($mil) [6]box_office_gross($mil)
oscar_data = [
["The Shape of Water", 2017, 6.914, 123, ['sci-fi', 'drama'], 19.4,
195.243464],
["Moonlight", 2016, 6.151, 110, ['drama'], 1.5, 65.046687],
["Spotlight", 2015, 7.489, 129, ['drama', 'crime', 'history'],
20.0, 88.346473],
["Birdman", 2014, 7.604, 119, ['drama', 'comedy'], 18.0,
103.215094],
["12 Years a Slave", 2013, 7.71, 133, ['drama', 'biography',
'history'], 20.0, 178.371993],
["Argo", 2012, 7.517, 120, ['thriller', 'drama', 'biography'],
44.5, 232.324128],
["The Artist", 2011, 7.942, 96, ['drama', 'melodrama', 'comedy'],
15.0, 133.432856],
["The King\'s Speech", 2010, 7.977, 118, ['drama', 'biography',
'history'], 15.0, 414.211549],
["The Hurt Locker", 2008, 7.298, 126, ['thriller', 'drama', 'war',
'history'], 15.0, 49.230772],
["Slumdog Millionaire", 2008, 7.724, 120, ['drama', 'melodrama'],
15.0, 377.910544],
["No Country for Old Men", 2007, 7.726, 122, ['thriller', 'drama',
'crime'], 25.0, 171.627166],
["The Departed", 2006, 8.456, 151, ['thriller', 'drama', 'crime'],
90.0, 289.847354],
["Crash", 2004, 7.896, 108, ['thriller', 'drama', 'crime'], 6.5,
98.410061],
["Million Dollar Baby", 2004, 8.075, 132, ['drama', 'sport'], 30.0,
216.763646],
["The Lord of the Rings: Return of the King", 2003, 8.617, 201,
['fantasy', 'drama', 'adventure'], 94.0, 1119.110941],
["Chicago", 2002, 7.669, 113, ['musical', 'comedy', 'crime'], 45.0,
306.776732],
['A Beautiful Mind', 2001, 8.557, 135, ['drama', 'biography',
'melodrama'], 58.0, 313.542341],
["Gladiator", 2000, 8.585, 155, ['action', 'drama', 'adventure'],
103.0, 457.640427],
["American Beauty", 1999, 7.965, 122, ['drama'], 15.0,
356.296601],
["Shakespeare in Love", 1998, 7.452, 123, ['drama', 'melodrama',
'comedy', 'history'], 25.0, 289.317794],
["Titanic", 1997, 8.369, 194, ['drama', 'melodrama'], 200.0,
2185.372302],
["The English Patient", 1996, 7.849, 155, ['drama', 'melodrama',
'war'], 27.0, 231.976425],
["Braveheart", 1995, 8.283, 178, ['drama', 'war', 'biography',
'history'], 72.0, 210.409945],
["Forrest Gump", 1994, 8.915, 142, ['drama', 'melodrama'], 55.0,
677.386686],
["Schindler\'s List", 1993, 8.819, 195, ['drama', 'biography',
'history'], 22.0, 321.265768],
["Unforgiven", 1992, 7.858, 131, ['drama', 'western'], 14.4,
159.157447],
["Silence of the Lambs", 1990, 8.335, 114, ['thriller', 'crime',
'mystery', 'drama', 'horror'], 19.0, 272.742922],
["Dances with Wolves", 1990, 8.112, 181, ['drama', 'adventure',
'western'], 22.0, 424.208848],
["Driving Miss Daisy", 1989, 7.645, 99, ['drama'], 7.5,
145.793296],
["Rain Man", 1988, 8.25, 133, ['drama'], 25.0, 354.825435],
]
def column_sum(data, column):
result = 0
for row in data:
result += row[column]
return result
def column_mean(data, column):
total = column_sum(oscar_data, 6)
mean = total / len(data)
return mean
# < write code here >
mean_score = column_mean(oscar_data, 2)
print('Average rating: {:.2f}'.format(mean_score))
mean_length = column_mean(oscar_data, 3)
print('Average length: {:.2f} min.'.format(mean_length))
mean_budget = column_mean(oscar_data, 5)
print('Average budget: ${:.2f} mil.'.format(mean_budget))
mean_gross = column_mean(oscar_data, 6)
print('Average revenue: ${:.2f} mil.'.format(mean_gross))
In: Computer Science
In: Accounting
1. Obtain a benzoic acid pellet, determine the mass of the pellet on the analytical balance and record the mass in your hard covered note book. The error for the analytical balance is 0.0005 g. Attach approximately 10.0 cm of fuse wire as shown by your Instructor (use the length of the card that holds the fuse wire, the card is already calibrated in heat units, cal or 4.18 J units) and adjust it to give firm contact with the benzoic acid pellet. Avoid kinks in the fuse wire.
2. Carefully assemble the bomb, keeping surfaces of closure scrupulously clean. Dismantled parts should be placed on a clean, dry paper towel. Place the bomb on the bench next to the O2 cylinder. Tighten cover by hand. The Instructor must assist you in connecting the bomb to the O2 cylinder, and slowly admit oxygen to a final pressure of 20 atm (280 psi.) Close valves on cylinder. Relieve pressure in line by means of the black knob on the regulator. Remove the gas coupling and check the circuit again.
3. Place the bomb in the calorimeter and make sure the ignition wires are connected properly. Carefully fill the inner reservoir in the calorimeter with 2000 mL distilled water, using the volumetric flask provided. The water should completely cover the bomb; no oxygen bubbles should escape from the bomb if the seal is good. If there is a substantial leak, the bomb should be dried and refilled with oxygen. Small leaks are insignificant.
4. Connect the motor and pulley experiment with the o-ring provided and starts the stirrer. Connect the leads on the outside of the bomb jacket to the 10 cm fuse in the igniter
. 5. Turn on the stirrer. For this, data points should be collected every ten seconds up to a total of 150 data points.
6. After at least 12 data points have been collected, and the temperature is reasonably constant or shows only a small up- or downward trend, press and hold the ignition button on the ignitor for approximately 1second. You will see the red light on the ignition box flash on and off again, showing that the fuse wire has burned. You should NOT be standing over the bomb while igniting the bomb!! Stand back from the bomb for at least 15 seconds. If combustion has occurred, the temperature will start to rise within the next two or three data points.
7. Keep recording data until the 150 points finishes.
8. Remove the bomb from the calorimeter and relieve the pressure by opening the valve. BE SURE to open the release valve before trying to unscrew the top of the bomb! 9. Measure the remaining length of unoxidized fuse wire. (This information is needed to correct for its heat of combustion). Carefully clean and dry the calorimeter and sample pan.
10. Repeat this procedure with the second benzoic acid pellet.
11. Once you have good data for benzoic acid, allowing you to calculate the calorimeter constant C, repeat the full procedure for each of the two sucrose samples.
In: Chemistry
This course contains a Course Project, where you will be required to submit one draft of the project at the end of Week 5, and the final completed project at the end of Week 7. Using the financial statements for Celgene Corporation and Gilead Sciences, Inc., respectively, you will calculate and compare the financial ratios listed further down this document for the fiscal year ending 2015, and prepare your comments about the two companies' performances based on your ratio calculations. The entire project will be graded by the instructor at the end of the final submission in Week 7, and one grade will be assigned for the entire project. Financial Statements Below is the link for the financial statements for Celgene Corporation for the fiscal year ending 2016. http://ir.celgene.com/sec.cfm?view=all (Links to an external site.)Links to an external site. When you arrive at this website, please do the following. First, under View, select Annual Filings using the drop-down arrow labeled All Filings and then select 2017, using the drop-down arrow labeled Year, You should select the 10k dated 2/10/2017 and choose to download in PDF, HTML, or Excel format. The PDF format is the best format for searching. Below is the link for the financial statements for Gilead Sciences, Inc. for the fiscal year ending 2015. http://investors.gilead.com/phoenix.zhtml?c=69964&p=irol-sec (Links to an external site.)Links to an external site. First, select 2017 under the Year filter using the drop-down arrow labeled All Years and then select Annual filings under the Groupings filter using the drop-down arrow labeled All Forms. Press the large Search button to access the requested annual filing for 2016. You should select the 10k dated 2/27/2017, and choose to download it in PDF, Word, or Excel format. The PDF format is the best format for searching. ANSWER the following 16 ratios and include formulas Earnings per Share of Common Stock Current Ratio Gross (Profit) Margin Percentage Rate of Return (Net Profit Margin) on Sales Inventory Turnover Days' Inventory Outstanding (DIO) Accounts Receivable Turnover Days' Sales Outstanding (DSO) Asset Turnover Rate of Return on Total Assets (ROA) Debt Ratio Times-Interest-Earned Ratio Dividend Yield [For the purposes of this ratio, use Yahoo Finance to look up current dividend per share and stock price; just note the date that you looked up this information.] Rate of Return on Common Stockholders' Equity (ROE) Free cash flow Price-Earnings Ratio (Multiple) [For the purpose of this ratio, look up the market price per share as of December 30, 2016 for Celgene Corporation and for Gilead Sciences, Inc..] Thank You!!
In: Finance
Case 1–2: True Religion Jeans: Flash in the Pants or Enduring Brand?
Founded in 2002 by Jeff Lubell, True Religion had become one of the largest premium denim brands in the United States by 2012. Although True Religion made its debut in upscale department stores and trendy boutiques a decade earlier, the company owned 86 full price retail stores and 36 outlet stores in the United States as well as 30 stores in international markets by the end of 2012. The company’s domestic retail store business accounted for about 60% of revenues and 64% of operating profit before unallocated corporate expenses in 2012. Just five years earlier, the U.S. retail store segment generated only 17% of sales and 25% of operating profit before unallocated corporate expenses.
Jeff Lubell’s vision of the company had come true—at least partly. The company had transformed itself from a jeans designer into an apparel retailer with it own brand à la Buckle and Diesel. At the same time, True Religion had managed to shift its product mix so that sportswear accounted for almost 35% of sales in its company-owned stores. Lubell felt these two ingredients were critical to establishing True Religion as a “lifestyle brand.” The ultimate in product differentiation, many companies attempt to create so-called “lifestyle” brands that transcend product category and inspire deep consumer loyalty. Lubell felt becoming a lifestyle brand was the key to insulating True Religion from the inevitable fluctuations in fashion trends.
Moreover, True Religion’s sales had grown at an average annual rate of almost 22% from 2007-2012. The company’s return on invested capital was an impressive 27% and its return on average assets was 12% in 2012. Despite these factors, press articles and analyst reports on True Religion described the company as, “the struggling maker of premium denim.”1 A New York Post article entitled “Escape From Hell for True Religion” described private equity firm, TowerBrook, as the company’s “savior,”2 when the company announced it had been acquired by TowerBrook in 2013. Other denim brands, such as Jeff Rudes’ J Brand, appeared to be usurping True Religion’s position as the “must have” denim brand for young consumers.
What had gone wrong at True Religion? Was the change in ownership the answer to the company’s problems? Was premium denim destined to go the way of Flash Dance legwarmers and Crocs as fast fashion from the likes of H&M became more mainstream? Private equity investors had snapped up stakes in both established and up-and-coming premium denim brands in the past five years—leaving just one publicly traded premium jeans maker, Joe’s Jeans. Should investors stay away from the industry?
In: Finance
In: Economics
In: Accounting
In: Accounting
Refine Assumptions for PPE Forecast
Provided below is FY2016 information for Medtronic PLC.
| Medtronic plc | ||
|---|---|---|
| Consolidated Statement of Income | ||
| ($ millions) | Apr. 29, 2016 | |
| Net sales | $29,499 | |
| Costs and expenses | ||
| Cost of products sold | 9,142 | |
| Research and development expenses | 2,224 | |
| Selling, general, and administrative expense | 9,469 | |
| Special charges (gains), net | 70 | |
| Restructuring charge, net | 290 | |
| Certain litigation charges, net | 26 | |
| Acquisition-related items | 283 | |
| Amortization of intangiable assets | 1,931 | |
| Other expense, net | 107 | |
| Operating profit | 5,957 | |
| Interest expense, net | 955 | |
| Income from operations before income taxes | 5,002 | |
| Provision for income taxes | 950 | |
| Net income | $4,052 | |
| Medtronic plc | |||
|---|---|---|---|
| Consolidated Balance Sheets | |||
| ($ millions) | Apr. 29, 2016 | Apr. 24, 2015 | |
| Current assets | |||
| Cash and cash equivalents | $3,042 | $5,009 | |
| Investments | 9,758 | 14,637 | |
| Accounts receivable | 5,562 | 5,112 | |
| Inventories | 3,473 | 3,463 | |
| Tax assets | 697 | 1,335 | |
| Prepaid expenses and other current assets | 1,234 | 1,454 | |
| Total current assets | 23,766 | 31,010 | |
| Property, plant, and equipment, net | 5,007 | 4,865 | |
| Goodwill | 41,500 | 40,530 | |
| Other intangible assets, net | 26,899 | 28,101 | |
| Long-term tax assets | 1,383 | 774 | |
| Other assets | 1,559 | 1,737 | |
| Total assets | $100,114 | $107,017 | |
| Current liabilities | |||
| Short-term borrowings | $1,159 | $2,600 | |
| Accounts payable | 1,709 | 1,610 | |
| Accrued compensation | 1,712 | 1,611 | |
| Accrued income taxes | 566 | 935 | |
| Deferred tax liabilities | - | 119 | |
| Other accrued expenses | 2,185 | 2,464 | |
| Total current liabilities | 7,331 | 9,339 | |
| Long-term debt | 30,247 | 33,752 | |
| Long-term accrued compensation | 1,759 | 1,535 | |
| Long-term accrued income taxes | 2,903 | 2,476 | |
| Long-term deferred tax liabilities | 3,729 | 4,700 | |
| Other long-term liabilities | 1,916 | 1,819 | |
| Total liabilities | 47,885 | 53,621 | |
| Shareholders' equity | |||
| Ordinary shares | - | - | |
| Retained earnings | 54,097 | 54,580 | |
| Accumulated other comprehensive (loss) | (1,868) | (1,184) | |
| Total shareholders' equity | 52,229 | 53,396 | |
| Total liabilities and shareholders' equity | $100,114 | $107,017 | |
a. Use the financial statements along with the additional
information below to forecast property, plant and equipment, net
for FY2017.
| CAPEX in FY2016 | $1,101 million |
| Depreciation expense in FY2016 | 945 million |
| Forecasted FY2017 net sales | 35,842 million |
Round to the nearest million.
Forecasted PPE, net for FY2017 $Answer
million
b. Suppose the company discloses in a press release that
accompanies its year-end SEC filing that anticipated CAPEX for
FY2017 is $1.5 billion. Use the guidance to refine your forecast of
property, plant and equipment, net for FY2017.
$Answer
million
In: Accounting