Рет қаралды 598
In this video I have discussed on Interview question asked in KPMG interview for data engineers.
Write a pyspark query to find avg salary of each dept also rename the column.
from pyspark.sql.functions import avg
Sample data
data = [("John", "IT", 5000),
("Alice", "HR", 6000),
("Bob", "IT", 5500),
("Eve", "Finance", 7000),
("Charlie", "HR", 6500),
("David", "Finance", 7500)]
columns = ["Name", "Department", "Salary"]
Create a DataFrame
df = spark.createDataFrame(data, columns)
df.show()
Solution is in PySpark
Part1 Video : • Question 12: KPMG Inte...
Check out this video and do let me know your doubts we can connect on
linkedIn : / priyam-jain-0946ab199
Do subscribe @pysparkpulse for more such Questions.
#pyspark #spark #bigdata #bigdataengineer #dataengineering #dataengineer #deloitte #pwc #mnc #kpmg #interviewquestions