Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this exercise, please first create a DataFrame to store the following table and then finish the questions (use np.nan to represent missing value NaN)
In this exercise, please first create a DataFrame to store the following table and then finish the questions (use np.nan to represent missing value NaN) \[ \text { ord_no } \quad \text { customer_id } \] 0 NaN NaN NaN NaN 1 NaN 270.65 2012-09-10 3001.0 270002.065 .26 NaN 3001.0 3 70003.0 NaN NaN NaN 4 NaN 948.50201209103002.05 70005.0 2400.60 2012-07-27 3001.0 6NaNNaN 2012-09-10 3001.0 770010.01983.43NaN3004.0870003.02480.40201210103003.0970012.0 250.45 2012-06-27 3002.010 NaN 75.29 2012-08-17 3001.011 NaN NaN NaN NaN Q1. Count the number of NaNs in dataframe (by column) and fill all the NaNs with -1 In[]: Q2. Write a Pandas program to select columns whose number of NaNs between 2 and 4 In[]: Q3. For column 2, write a Pandas program to replace the missing values with median of the values present in this column In[]: Q4. For column 1, 3, 4, write a Pandas program to replace the missing values with the most frequent values present in each column In[]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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