application_vnd.jupyter.stderr_output_2.png text_plain_output_1.png
from pyspark.sql import SparkSession

from pyspark.sql.functions import col , round

spark = SparkSession.builder.appName('SparkByExamples.com').getOrCreate()

df = spark.read.csv('/kaggle/input/students-exam-scores/Original_data_with_more_rows.csv', header=True)

df.createOrReplaceTempView('students_score')

df = df.withColumn('total_score', col('MathScore') + col('ReadingScore') + col('WritingScore'))
df = df.withColumn('Percentage', round(col('total_score') / 300 * 100, 2))
df.show()