Complete the code to read a CSV file into a Spark DataFrame.
df = spark.read.[1]("data.csv")
The csv method reads CSV files into a DataFrame.
Complete the code to drop rows with any null values.
clean_df = df.[1]()The dropna() method removes rows with null values.
Fix the error in the code to filter rows where 'age' is greater than 18.
adults = df.filter(df.age [1] 18)
The filter should keep rows where age is greater than 18, so use >.
Fill both blanks to create a dictionary of word lengths for words longer than 3 characters.
lengths = {word: [1] for word in words if len(word) [2] 3}The dictionary maps each word to its length, but only for words longer than 3 characters.
Fill all three blanks to create a filtered dictionary with uppercase keys and values greater than 0.
result = [1]: [2] for k, v in data.items() if v [3] 0}
The dictionary comprehension uses uppercase keys, original values, and filters values greater than zero.
