We can add a new column using the withColumn() method of the data frame, like below
from pyspark.sql.functions import lit
df = sqlContext.createDataFrame(
[(1, "a"), (2, "b")], ("c1", "c2"))
df_new_col = df.withColumn("c3", lit(0))
df_new_col.show()
Thanks,
Saikrishna Pujari
Sr. Spark Technical Solutions Engineer, Databricks