Fix Python – Convert pyspark string to date format
I have a date pyspark dataframe with a string column in the format of MM-dd-yyyy and I am attempting to convert this into a date column.
I tried:
df.select(to_date(df.STRING_COLUMN).alias(‘new_date’)).show()
And I get a string of nulls. Can anyone help?
….