1. Learn
  2. /
  3. Courses
  4. /
  5. ETL and ELT in Python

Connected

Exercise

Applying advanced transformations to DataFrames

pandas has a plethora of built-in transformation tools, but sometimes, more advanced logic needs to be used in a transformation. The apply function lets you apply a user-defined function to a row or column of a DataFrame, opening the door for advanced transformation and feature generation.

The find_street_name() function parses the street name from the "street_address", dropping the street number from the string. This function has been loaded into memory, and is ready to be applied to the raw_testing_scores DataFrame.

Instructions

100 XP
  • In the definition of the transform() function, use the find_street_name() function to create a new column with the name "street_name".
  • Use the transform() function to clean the raw_testing_scores DataFrame.
  • Print the head of the cleaned_testing_scores DataFrame, observing the new "street_name" column.