inverting df.loc values horizontally code example
Example 1: reverse pd based on index
data.iloc[::-1]
Example 2: pandas dataframe to change data to horizontally
| id | name | country01 | sort01 | country02 | sort02 | country03 | sort03 |
| 1 | Foo | USA | 1 | Japan | 2 | China | 3 |
| 2 | Bar | USA | 1| UK | 3 | France | 4 |
| 3 | Zap | Japan | 2 | UK | 3 | Russia | 5 |