Python Function Modify Dataframe In Pyspark