From 12973e5a2e8cf289ceeacf9df16467ad2dd99425 Mon Sep 17 00:00:00 2001 From: sagarzemosolabs <110030742+sagarzemosolabs@users.noreply.github.com> Date: Thu, 28 Mar 2024 19:25:15 +0530 Subject: [PATCH] Update pyspark-lit.py --- pyspark-lit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyspark-lit.py b/pyspark-lit.py index 795d4cd..f8cf6d8 100644 --- a/pyspark-lit.py +++ b/pyspark-lit.py @@ -20,5 +20,5 @@ from pyspark.sql.functions import when -df3 = df2.withColumn("lit_value2", when(col("Salary") >=40000 & col("Salary") <= 50000,lit("100")).otherwise(lit("200"))) -df3.show(truncate=False) \ No newline at end of file +df3 = df2.withColumn("lit_value2", when((col("Salary") >= 40000) & (col("Salary") <= 50000), lit("100")).otherwise(lit("200"))) +df3.show(truncate=False)