1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Data Pipelines

Exercise

Filtering pandas DataFrames

Once data has been extracted from a source system, it's time to transform it! Often, source data may have more information than what is needed for downstream use cases. If this is the case, dimensionality should be reduced during the "transform" phase of the data pipeline.

pandas has been imported as pd, and the extract() function is available to load a DataFrame from the path that is passed.

Instructions

100 XP
  • Use the extract() function to load the DataFrame stored in the "sales_data.parquet" path.
  • Update the transform() function to return all rows and columns with "Quantity Ordered" greater than 1.
  • Further filter the DataFrame to only include columns "Order Date", "Quantity Ordered" and "Purchase Address".
  • Return the filtered DataFrame.