Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!