Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

imageimageimageimage

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Elements Of Chemical Reaction Engineering

Authors: H. Fogler

6th Edition

013548622X, 978-0135486221

More Books

Students also viewed these Programming questions

Question

30 m is what percent of 3 km?

Answered: 1 week ago