Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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.
Step by Step Solution
★★★★★
3.45 Rating (155 Votes )
There are 3 Steps involved in it
Step: 1
Solutions Step 1 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 valueQ1 nparray2 npnan 6 7 3 2 Explanation This ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started