19. pyspark interview questions and answer - customer analysis
Автор: learn by doing it
Загружено: 2024-12-15
Просмотров: 1706
#pysparkinterview #pyspark #dataenginnerjobs
🔥 Crack your next PySpark interview with confidence! In this video, we dive into recently asked PySpark interview questions focused on customer analysis. Learn how to work with large datasets, use PySpark transformations, and apply advanced analytical techniques to solve real-world problems. We'll cover:
customer first login
customer last login
customer total login
etc.
Want more similar videos- hit like, comment, share and subscribe
❤️Do Like, Share and Comment ❤️
❤️ Like Aim 5000 likes! ❤️
➖➖➖➖➖➖➖➖➖➖➖➖➖
Please like & share the video.
➖➖➖➖➖➖➖➖➖➖➖➖➖
script
from pyspark.sql import SparkSession
from pyspark.sql.types import StructType, StructField, StringType, TimestampType
schema = ["UserID", "UserName", "Login", "Logout"]
Sample data for users with multiple login/logout sessions
data = [
("U001", "Alice Johnson", "2024-12-15 08:30:00", "2024-12-15 09:30:00"),
("U001", "Alice Johnson", "2024-12-15 10:00:00", "2024-12-15 11:00:00"),
("U002", "Bob Smith", "2024-12-15 09:00:00", "2024-12-15 09:45:00"),
("U002", "Bob Smith", "2024-12-15 10:30:00", "2024-12-15 12:00:00"),
("U002", "Bob Smith", "2024-12-15 13:00:00", "2024-12-15 14:00:00"),
("U003", "Charlie Brown", "2024-12-15 08:45:00", None),
("U003", "Charlie Brown", "2024-12-15 14:00:00", "2024-12-15 15:30:00"),
("U004", "Diana Prince", "2024-12-15 10:00:00", "2024-12-15 11:30:00"),
("U004", "Diana Prince", "2024-12-15 12:00:00", None)
]
df=spark.createDataFrame(data,schema)
df.show()
df.printSchema()
➖➖➖➖➖➖➖➖➖➖➖➖➖
AWS DATA ENGINEER : • AWS DATA ENGINEER
Azure data factory :
• Azure Data Factory
Azure data engineer playlist : • Azure Data Engineer
SQL PLAYLIST : • SQL playlist
PYSPARK PLAYLIST -
• Pyspark Tutorial
➖➖➖➖➖➖➖➖➖➖➖➖➖
📣Want to connect with me? Check out these links:📣
Join telegram to discuss https://t.me/+Cb98j1_fnZs3OTA1
➖➖➖➖➖➖➖➖➖➖➖➖➖
what we have covered in this video:
➖➖➖➖➖➖➖➖➖➖➖➖➖
Hope you liked this video and learned something new :)
See you in next video, until then Bye-Bye!
➖➖➖➖➖➖➖➖➖➖➖➖➖
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: