### Get week number of year from date from pyspark.sql.functions import weekofyear df1 = df_student.withColumn('week_of_year',weekofyear(df_student.birthday)) df1.show()