Рет қаралды 4,006
deloitte interview question in pyspark| pyspark interview questions | #interview | #sql |#data
In this video we will be solving DELOITTE interview question in PySpark.
Dataframe Create Code :
======================
1)
product_data = [
(1, 'Laptops', 'Electronics'),
(2, 'Jeans', 'Clothing'),
(3, 'Chairs', 'Home Appliances')
]
product_schema = ['product_id', 'product_name', 'category']
product_df = spark.createDataFrame(data = product_data , schema = product_schema)
product_df.show()
2)
sales_data = [
(1, 2019, 1000.00),
(1, 2020, 1200.00),
(1, 2021, 1100.00),
(2, 2019, 500.00),
(2, 2020, 600.00),
(2, 2021, 900.00),
(3, 2019, 300.00),
(3, 2020, 450.00),
(3, 2021, 400.00)
]
sales_schema = ['product_id', 'year', 'total_sales_revenue']
sales_df = spark.createDataFrame(data = sales_data , schema = sales_schema)
sales_df.show()
Need Help ? Connect With me 1:1 - topmate.io/dew...
SQL Approach and Step by Step Solution Video :
• deloitte interview que...
PySpark Installation and Setup : • Spark Installation | P...
DSA In Python Interview Series : • dsa for data engineer ...
PySpark Interview Series : • pyspark interview ques...
Pandas Interview Series : • pandas interview quest...
SQL Interview Series : • sql interview question...
Let's connect on LinkedIn : / dhirajgupta141
#deloitte #sql #interview #dataengineers #dataanalytics #datascience #StrataScratch #Facebook #data #dataengineeringinterview #codechallenge #datascientist #pyspark #CodingInterview
#dsafordataguy