Question: reorder columns in a dataframe.
wenmengliu opened this issue · comments
Crystal commented
Is there a way to reorder columns of a dataframe?
eg/
df:
col1 | col2 | col3 |
---|---|---|
11 | 21 | 10 |
12 | 22 | 40 |
we want to order df in [col2, col1, col3] as follow:
col2 | col1 | col3 |
---|---|---|
21 | 11 | 10 |
22 | 12 | 40 |
Thank you!
Christian Mang commented
Hi,
you can select columns by index or by name: DataFrame.Select (see example). Just select all columns in your needed order.