filmov
tv
JLL Pyspark Interview Question - Get Top3 pickup locations
Показать описание
One of the Pyspark Interview question recently asked in JLL interview.
We need to Get Top3 pickup locations.
Lets see how we can achieve this by using GroupBy count and limit.
Mentioning the dataframe details here
# Define the schema
schema = StructType([
StructField("reqid", IntegerType(), True),
StructField("pickup_location", StringType(), True)
])
# Create a DataFrame with the defined schema
data = [(48, "Airport"), (49, "Office"),(50, "Hospital"),(51, "Airport"),(52, "Hospital"),(53, "Shoppingmall"),(54, "Office"),(55, "Hospital"),(56, "Hospital")]
For more Azure Data Bricks interview questions. Check out our playlist.
Contact us:
Follow us on
We need to Get Top3 pickup locations.
Lets see how we can achieve this by using GroupBy count and limit.
Mentioning the dataframe details here
# Define the schema
schema = StructType([
StructField("reqid", IntegerType(), True),
StructField("pickup_location", StringType(), True)
])
# Create a DataFrame with the defined schema
data = [(48, "Airport"), (49, "Office"),(50, "Hospital"),(51, "Airport"),(52, "Hospital"),(53, "Shoppingmall"),(54, "Office"),(55, "Hospital"),(56, "Hospital")]
For more Azure Data Bricks interview questions. Check out our playlist.
Contact us:
Follow us on
Комментарии