Having trouble converting the following list to a pyspark dataframe.
lst = [[1, 'A', 'aa'], [2, 'B', 'bb'], [3, 'C', 'cc']]
cols = ['col1', 'col2', 'col3']
Desired output:
+----------+----------+----------+
| col1 | col2 | col3 |
+----------+----------+----------+
| 1 | A | aa |
+----------+----------+----------+
| 2 | B | bb |
+----------+----------+----------+
| 3 | C | cc |
+----------+----------+----------+
I'm essentially looking for the pandas equivalent of:
df = pd.DataFrame(data=lst,columns=cols)