1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to PySpark

Connected

Exercise

Pandas UDFs

This exercise covers Pandas UDFs, so that you can practice their syntax! As you work through this exercise, notice the differences between the Pyspark UDF from the last exercise and this type of UDF.

Remember, there's already a SparkSession called spark in your workspace!

Instructions

100 XP
  • Define the add_ten_pandas() function as a pandas UDF.
  • Add a new column to the DataFrame called "10_plus" that applies the pandas UDF to the df column "value".
  • Show the resulting DataFrame.