DataFrame.
toDF
Returns a new DataFrame that with new specified column names
DataFrame
new column names
Examples
>>> df.toDF('f1', 'f2').collect() [Row(f1=2, f2='Alice'), Row(f1=5, f2='Bob')]
previous
pyspark.sql.DataFrame.take
next
pyspark.sql.DataFrame.toJSON