Reference docs
Returns a new DataFrame that with new specified column names
DataFrame
cols (str) – new column names
Examples
>>> df.toDF('f1', 'f2').collect() [Row(f1=2, f2='Alice'), Row(f1=5, f2='Bob')]