Problems on Data Cleaning and Processing For Machine Learning

9 / 12

Operations on two dataframes

  • Define a DataFrame with the following information as shown below and save it in a variable named df1

    enter image description here

  • Define a second DataFrame with the following information as shown below and save it in a variable named df2

    enter image description here

  • Now, write a function display_df, this function will take 3 parameters as inputs. The first 2 parameters would be 2 DataFrames, the 3rd parameter should be a string

  • The function should first merge those 2 DataFrames into one single DataFrame along rows
  • It should then return only those rows where the name column of the DataFrame matches the 3rd parameter passed to the function
  • For example, the following call display_df(df1,df2,"Keith") should return the below output enter image description here
  • Use the Jupyter notebook given on the right side of the split-screen to write your code and execute it
  • Once done, click on the Submit Answer button given above
See Answer

No hints are availble for this assesment


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...