Pyspark Create A Dataframe In Python Methods Vs Functions