Complete the code to read data from a CSV file into a Spark DataFrame.
df = spark.read.[1]("data/input.csv")
The csv method reads CSV files into a DataFrame.
Complete the code to select the 'age' column from the DataFrame.
ages = df.select([1])The select method requires column names as strings.
Fix the error in filtering rows where 'score' is greater than 50.
filtered = df.filter(df.score [1] 50)
Use > to filter rows with score greater than 50.
Fill both blanks to create a dictionary comprehension that maps words to their lengths for words longer than 3 characters.
lengths = {word: [1] for word in words if [2]The dictionary maps each word to its length, filtering words longer than 3 characters.
Fill all three blanks to create a dictionary comprehension that maps uppercase words to their scores if the score is positive.
result = [1]: [2] for word, score in data.items() if score [3] 0}
word.lower() instead of uppercase.The dictionary maps uppercase words to their positive scores.
