Create a Jupyter notebook called hw1_yourlastname .ipynb where you replace yourlastname with your actual last name....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a Jupyter notebook called hw1_yourlastname .ipynb where you replace yourlastname with your actual last name. After completing parts 1-3, upload your iPython notebook to Canvas. Use your iPython notebook to demon- strate that your functions work, i.e that you have tested them. Also organize your notebook using headers and text as necessary to separate the different problems. See the sample output in this Jupyter notebook. Note the last problem needs two methods from the math module. 1. Write a function take_first_n that takes a list 1 and an integer n as arguments. The function should return (as a new list) the first n values from the list. In the event that n is greater than the length of 1, the entire list should be returned. 2. Write a function mean_of_list that takes list_to_be_averaged as its argument and returns the average (mean) of that list. It should use the accumulator pattern to compute the average and return 0. if list_to_be_averaged is empty. Python has a built-in method for computing averages, but we're not using it here. This is programming practice. 3. Write a method all ones that takes a parameter v assumed to be a list of numbers and returns a list of the same length but with 1's instead of whatever values v contains. For instance, all.ones ([1,2]) would return [1,1] and all ones ([0,1,2,3]) would return [1,1,1,1]. Create a Jupyter notebook called hw1_yourlastname .ipynb where you replace yourlastname with your actual last name. After completing parts 1-3, upload your iPython notebook to Canvas. Use your iPython notebook to demon- strate that your functions work, i.e that you have tested them. Also organize your notebook using headers and text as necessary to separate the different problems. See the sample output in this Jupyter notebook. Note the last problem needs two methods from the math module. 1. Write a function take_first_n that takes a list 1 and an integer n as arguments. The function should return (as a new list) the first n values from the list. In the event that n is greater than the length of 1, the entire list should be returned. 2. Write a function mean_of_list that takes list_to_be_averaged as its argument and returns the average (mean) of that list. It should use the accumulator pattern to compute the average and return 0. if list_to_be_averaged is empty. Python has a built-in method for computing averages, but we're not using it here. This is programming practice. 3. Write a method all ones that takes a parameter v assumed to be a list of numbers and returns a list of the same length but with 1's instead of whatever values v contains. For instance, all.ones ([1,2]) would return [1,1] and all ones ([0,1,2,3]) would return [1,1,1,1].
Expert Answer:
Related Book For
Accounting Information Systems
ISBN: 978-0133428537
13th edition
Authors: Marshall B. Romney, Paul J. Steinbart
Posted Date:
Students also viewed these computer network questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Mansfield Congregational Church (MCC) is a small organization in Connecticut with only seventeen employees. Though its funds are dwindling, the MCC wants to hire a full-time maintenance employee to...
-
Moped, Inc. purchased machinery at a cost of $44,000 on January 1, 2017. The expected useful life is 5 years and the asset is expected to have salvage value of $4,000. Moped depreciates its assets...
-
Explain the effect of subcooling and superheating on COP of Vapor Compression Cycle.
-
A fully charged capacitor initially has an air gap and is disconnected from the battery. A dielectric material is inserted between the plates. What happens to \((a)\) the free charge at the surface...
-
Assume you have been given the following information on Purcell Industries: Current stock price = $15........................,,,,,..Exercise price of option = $15 Time to maturity of option = 6...
-
QUESTION THREE (a) (b) Joseph intends to start a small business specializing in software development to cater for the youth; however a business consultant has advised him to be extra careful before...
-
Sofia Lofts case, but under a new set of assumptions on page 11 of the case. First re-read the Sofia Lofts case, then click here to download the new page 11. Specifically, you are to write up a brief...
-
Electro-Phi Inc. (the "Company") is a utility provider that sells electricity to the public. The Company produces the electricity using various forms of power generation, including the burning of...
-
Provide TWO big brands/companies you think a person who has a passion for home renovation and construction/ ready mix concrete industry (production line, operations and sales) could be an influencer...
-
Health Care Information Standards and Structures Question How can public health agencies that utilize health information exchanges make their patients feel more comfortable with consenting/...
-
Vital-E Nutrition and answer the following: What types of track and trace capabilities could help VEN detect temperature problems and respond before the product is ruined? Are autonomous trucks a...
-
Q5. Meiying is a student studying Finance Law. Meiying has been watching the stock markets all her life and finds them extremely interesting. Meiying has developed a good sense of the market and has...
-
Kevin wanted to make some extra money to help pay for his educational expenses. As he was looking through the classified ads, he saw a job paying $15.00 per hour for part-time bathroom attendant at a...
-
2.26 The density of 800 bbl of 14-lbm/gal mud must be increased to 14.5 lbm/gal using API barite. The total mud volume is limited to 800 bbl. Compute the volume of old mud that should be discarded...
-
Is the modified 5-question approach to ethical decision making superior to the modified moral standards or modified Past in approach?
-
Figure shows that organizational culture and the design of an AIS influence one another. What does this imply about the degree to which an innovative system developed by one company can be...
-
Which parts of Figure would accurately depict almost every organizations revenue cycle? Which parts would change? Take Customer Order Employee Inventory Customer Sale Employee Receive Cash Customer...
-
For each of the following independent cases of employee fraud, recommend how to prevent similar problems in the future. a. Abnormal inventory shrinkage in the audiovisual department at a retail chain...
-
Aside from Calories, what else do you need to obtain through your diet? (a) a complete protein (b) a complete carbohydrate (c) vitamins and minerals (d) both a complete protein and vitamins and...
-
Trace the path of blood through the body, beginning with blood returning from the tissues to the heart. Be sure to name each of the chambers of the heart.
-
Which blood vessels are responsible for nutrient and waste exchange with tissues?
Study smarter with the SolutionInn App