Question: solve this in python follow all instruction: import pandas as pd import numpy as np import math Problem 1 Write a function named filterDf that

solve this in python follow all instruction:

import pandas as pd import numpy as np import math Problem 1Write a function named filterDf that takes three parameters df_obj, a dataframeobject column_name, a categorical column name. cat, a category in the categoricalcolumn Your function will filter the given dataframe based on the value

import pandas as pd import numpy as np import math Problem 1 Write a function named filterDf that takes three parameters df_obj, a dataframe object column_name, a categorical column name. cat, a category in the categorical column Your function will filter the given dataframe based on the value of cat of the categorical column and return the filtered dataframe. def filterDf (df_obj, column_name, cat): # YOUR CODE HERE Test Case # This cell is for you to test your answer df=pd.DataFrame({ 'A': range (1,45,5), 'B': range (10,99,10), 'C' :4*['x']+['y']*3+ ['z']*2 }) filterDf (df, 'C', 'x'). # If your function works properly, you will see the following output Python Python Python

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 Programming Questions!