I have a DataFrame like this:
+-------+-----------+
| File | Column |
+-------+-----------+
| File1 | FirstName |
| File1 | LastName |
| File2 | ID |
| File2 | City |
| File2 | State |
+-------+-----------+
How could I group the File column and pass the respective Column values as rows? i.e.:
+-------+-----------+----------+-------+
| File | Col1 | Col2 | Col3 |
+-------+-----------+----------+-------+
| File1 | FirstName | LastName | NaN |
| File2 | ID | City | State |
+-------+-----------+----------+-------+
I'm thinking I need to pivot it and pass File as the index and Column as the values:
df.pivot(index='File', columns='', values='Column')
But here's where I'm stumped - I'm unsure what to pass for the columns parameter, or even if pivot is what I need.