pivot in pyspark
how to pivot a dataframe in pyspark
pivot and unpivot in pyspark
Create Dataframe Code :
=====================
Match Data
match_data = [
("Jadeja", 'Wankhede', 40, 2, 1),
("Hardik", 'Eden Gardens', 55, 0, 2),
("Jadeja", 'Eden Gardens', 25, 3, 0),
("Watson", 'Wankhede', 30, 1, 0),
("Hardik", 'Wankhede', 45, 0, 1),
("Jadeja", 'Wankhede', 60, 1, 1),
("Hardik", 'Eden Gardens', 45, 0, 3),
("Hardik", 'Eden Gardens', 30, 4, 0),
("Watson", 'Wankhede', 20, 2, 2),
("Watson", 'Eden Gardens', 50, 0, 0)
]
Creating DataFrame
match_schema = "Player_Name String , Stadium String , Runs int , Wickets int , Catches int"
match_df = spark.createDataFrame(data = match_data, schema = match_schema)
match_df.show()
Need Help ? Connect With me 1:1 - https://topmate.io/dewithdhairy
Let's connect on LinkedIn : / dhirajgupta141
top interview question and answer in pyspark :
• top interview questions and answers i...
PySpark Installation and Setup : • Spark Installation | PySpark Installa...
DSA In Python Interview Series : • dsa for data engineer | dsa for data ...
PySpark Interview Series : • pyspark interview questions and answers
Pandas Interview Series : • pandas interview questions and answers
SQL Interview Series : • sql interview questions and answers
#pivot #unpivot #pyspark #interview #deloitte #pivot #zs #fang #pyspark #sql #interview #dataengineers #dataanalytics #datascience #StrataScratch #Facebook #data #dataengineeringinterview #codechallenge #datascientist #pyspark #CodingInterview
#dsafordataguy #dewithdhairy #DEwithDhairy #dhiarjgupta #leetcode #topinterviewquestion
Информация по комментариям в разработке