Create a ipynb file called PandasA4credit.ipynb and complete the following. For this assignment load but DO...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a ipynb file called PandasA4credit.ipynb and complete the following. For this assignment load but DO NOT INSTALL NumPy and Pandas: run the following at the top of your script and then complete the questions: import numpy as np import pandas as pd Assume all arrays are NumPy arrays, all Series are Pandas series, etc., unless otherwise specified Everything is case sensitive, so BE CAREFUL After you create the object (e.g., Q1), DO NOT PRINT! Your file should something look like this: Q1 = ['Hello] Q2 = x[3:] Before attempting these make sure to watch 'Code Grade Walkthrough' in module 1 - if you do not you will not understand how assignments work! For reference: Code Grade tips and FAQ Code Grade - What to do if my code doesn't work? Create the following array (such that the second value is a missing value): [ 2. nan 6. 7. 3. 2.] Assign it to Q1. Use the sum method on Q1's array to find the sum. Assign it to Q2. Create the following pandas series (including the two missing values shown): 0 1 2 3 4 5 dtype: float64 Assign it to Q3. Determine which values are null values and which are not in the Q3 pandas series. Assign it to Q4. 4.0 5.0 0 1 2 2.0 NaN 1.0 NaN Recreate the following pandas series (including the two missing values shown): 4.0 5.0 2.0 NaN 1.0 NaN 3 4 5 dtype: float64 Assign it to Q5. Then, index to eliminate the missing values from Q5, using notnull(). Recreate the following pandas series (including the two missing values shown): 4.0 5.0 2.0 0 1 2 3 4 5 dtype: float64 Assign it to Q6. Then fill in the missing values with "100", using fillna(). NaN 1.0 NaN Create the following dataframe (including the missing values shown): 0 1 2 4 5 04 5.0 2.0 9.0 1.0 8 15 6.0 NaN 3.0 NaN 2 2 6 NaN 7.0 NaN 4.0 3 3 Assign it to Q7. Then fill in the missing values with "100", using .fillna(). Recreate the following pandas series (including the two missing values shown): 04.0 5.0 2.0 NaN 1.0 NaN 1 2 3 4 5 dtype: float64 Assign it to Q8. Then eliminate the missing values from Q8, using dropna(). Recreate the following dataframe (including the missing values shown): 0 1 2 3 4 5 04 5.0 2.0 9.0 1.0 8 15 6.0 NaN 3.0 NaN 2 2 6 NaN 7.0 NaN 4.0 3 Assign it to Q9. Then drop all columns with missing values using dropna(). Recreate the following dataframe (including the missing values shown): 0 1 2 3 4 5 04 5.0 2.0 9.0 1.0 8 15 6.0 NaN 3.0 NaN 2 2 6 NaN 7.0 NaN 4.0 3 Assign it to Q10. Then drop all rows with missing values using dropna(). Recreate the following dataframe (including the missing values shown): 0 1 2 3 4 5 04 5.0 2.0 9.0 1.0 8 15 6.0 NaN 3.0 NaN 2 2 6 NaN 7.0 NaN 4.0 3 Assign it to Q11. Then drop all rows without at least five observations, using dropna(). Recreate the following dataframe (including the missing values shown): 0 1 2 3 4 5 04 5.0 2.0 9.0 1.0 8 15 6.0 NaN 3.0 NaN 2 2 6 NaN 7.0 NaN 4.0 3 Assign it to Q12. Then add another column full of missing values. Create a ipynb file called PandasA4credit.ipynb and complete the following. For this assignment load but DO NOT INSTALL NumPy and Pandas: run the following at the top of your script and then complete the questions: import numpy as np import pandas as pd Assume all arrays are NumPy arrays, all Series are Pandas series, etc., unless otherwise specified Everything is case sensitive, so BE CAREFUL After you create the object (e.g., Q1), DO NOT PRINT! Your file should something look like this: Q1 = ['Hello] Q2 = x[3:] Before attempting these make sure to watch 'Code Grade Walkthrough' in module 1 - if you do not you will not understand how assignments work! For reference: Code Grade tips and FAQ Code Grade - What to do if my code doesn't work? Create the following array (such that the second value is a missing value): [ 2. nan 6. 7. 3. 2.] Assign it to Q1. Use the sum method on Q1's array to find the sum. Assign it to Q2. Create the following pandas series (including the two missing values shown): 0 1 2 3 4 5 dtype: float64 Assign it to Q3. Determine which values are null values and which are not in the Q3 pandas series. Assign it to Q4. 4.0 5.0 0 1 2 2.0 NaN 1.0 NaN Recreate the following pandas series (including the two missing values shown): 4.0 5.0 2.0 NaN 1.0 NaN 3 4 5 dtype: float64 Assign it to Q5. Then, index to eliminate the missing values from Q5, using notnull(). Recreate the following pandas series (including the two missing values shown): 4.0 5.0 2.0 0 1 2 3 4 5 dtype: float64 Assign it to Q6. Then fill in the missing values with "100", using fillna(). NaN 1.0 NaN Create the following dataframe (including the missing values shown): 0 1 2 4 5 04 5.0 2.0 9.0 1.0 8 15 6.0 NaN 3.0 NaN 2 2 6 NaN 7.0 NaN 4.0 3 3 Assign it to Q7. Then fill in the missing values with "100", using .fillna(). Recreate the following pandas series (including the two missing values shown): 04.0 5.0 2.0 NaN 1.0 NaN 1 2 3 4 5 dtype: float64 Assign it to Q8. Then eliminate the missing values from Q8, using dropna(). Recreate the following dataframe (including the missing values shown): 0 1 2 3 4 5 04 5.0 2.0 9.0 1.0 8 15 6.0 NaN 3.0 NaN 2 2 6 NaN 7.0 NaN 4.0 3 Assign it to Q9. Then drop all columns with missing values using dropna(). Recreate the following dataframe (including the missing values shown): 0 1 2 3 4 5 04 5.0 2.0 9.0 1.0 8 15 6.0 NaN 3.0 NaN 2 2 6 NaN 7.0 NaN 4.0 3 Assign it to Q10. Then drop all rows with missing values using dropna(). Recreate the following dataframe (including the missing values shown): 0 1 2 3 4 5 04 5.0 2.0 9.0 1.0 8 15 6.0 NaN 3.0 NaN 2 2 6 NaN 7.0 NaN 4.0 3 Assign it to Q11. Then drop all rows without at least five observations, using dropna(). Recreate the following dataframe (including the missing values shown): 0 1 2 3 4 5 04 5.0 2.0 9.0 1.0 8 15 6.0 NaN 3.0 NaN 2 2 6 NaN 7.0 NaN 4.0 3 Assign it to Q12. Then add another column full of missing values.
Expert Answer:
Answer rating: 100% (QA)
I can help you with this NumPy arrays problem Heres how to solve it Create the array import numpy as np Create the array with a missing value Q1 nparray2 npnan 6 7 3 2 This code first imports the NumP... View the full answer
Related Book For
Using Microsoft Excel and Access 2016 for Accounting
ISBN: 978-1337109048
5th edition
Authors: Glenn Owen
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
The information listed below refers to the employees of Lemonica Company for the year ended December 31, 2016. The wages are separated into the quarters in which they were paid to the individual...
-
Give the domain of each rational function using (a) Set-builder notation (b) Interval notation f(x) 2x - 3x + 4 3x + 8 -8
-
(a) Calculate the next two longest wavelengths in the K series (after the K line) of molybdenum. (b) What is the wavelength of the shortest wavelength in this series?
-
As a participant in a new mentoring program between your university and a local high school, you have volunteered to give a presentation to a Grade 10 class on the challenges in the new electronic...
-
Does Fairmont have any contactor personnel whose have terminated but are being paid through payroll after termination (e.g., ghost employees)?
-
The Lake Shore Inn is trying to determine its break-even point. The inn has 50 rooms that it rents at $60 a night. Operating costs are as follows. Salaries ...... $7,200 per month Utilities .........
-
3) The cost and revenue function in dollar terms for a fast-food joint is given as follows: C(x)=200x+200 and R(x) = 50x X + 4 If x is measured in hundreds of units, what is the break-even point for...
-
George Pharmacy is a pharmaceutical salesman who has been very successful at his job in the last few years. Unfortunately, his family life has not been very happy. Three years ago, his only child,...
-
Vince York practices medicine under the business title Vince York, M.D. During July, the medical practice completed the following transactions: i (Click the icon to view the accounts used by the...
-
Bill, age 27, earns a salary of $100,000 in 2020 when the consumer price index was 258. Bill's father earned a salary of 30,000 when the consumer price index was 85.5. As for 2020, who earned a...
-
= 4. If a mass ma 2m has initial velocity 4 m/s and mass m m is initially at rest, they undergo perfectly inelastic collision. Calculate: (a) the final velocity and CACA OD COAST DIMAMYG (b) %...
-
"I had an empire of the sun. It was happy and large. White people took it away from me. Little charango. My defeated race cries, defeated by another civilization." What historical and political event...
-
Delbert makes homemade salsa and sells it at his roadside produce stand. Delbert's weekly cost for making salsa can be determined using the equa- tion C=2.75j+40, where C represents the cost in dol-...
-
If courts in the United States suddenly dispensed with informal models of criminal justice and instead relied on formal procedure, what do you think would happen to the judicial system? explain and...
-
A company makes a product for which the standard hour is 0.2. The budgeted production hours for a given week were 10,500. During the week the production staff were able to produce 1,980 units of...
-
If (x) 0 on the interval [a, b], the definite integral gives the exact area under the curve between x = a and x = b.
-
Add a new field (Taxable) to the Product Table. Make the field a Yes/No data type. Add this new field to the Products form (not the Ch 12 Assignment 4 form you just created) to the right of the...
-
Snicks Board Shop has several questions for you that Excel can help answer. 1. The company is planning for the future and would like you to prepare a present value analysis. Using the file ch7-10,...
-
Create a new What SUP Present Value Analysis a. Using the ch7-01 file to start your work, modify that worksheet to do the following: i. Calculate the annuity payment required at the end of each year...
-
The codon change (Gly-12 to Val-12) in human H-ras that converts it to oncogenic H-ras has been associated with many types of cancers. For this reason, researchers would like to develop drugs to...
-
Outline the general strategy used in metagenomics.
-
You need to understand the approach described in question 3 in More Genetic TIPS before answering this question. A muscle-specific gene was cloned and then subjected to promoter bashing. As shown...
Study smarter with the SolutionInn App