Sort a table with irregular column info in Python
I have a messy table as per below, the data inside the table have integer and word/character. I want to sort the table from Info 5 to Info 1.
FruitInfo 1Info 2Info 3Info 4Info 5Appleqz2Grapew4Guavae7uKiwirnsm
Wish to get the result table as below.
FruitInfo 1Info 2Info 3Info 4Info 5KiwirnsmGuavae7uAppleqz2Grapew4
I have tried to use the str.contains, however it couldn't detect the integer.
i = ['Fruit', 'Info 1', 'Info 2', 'Info 3', 'Info 4', 'Info 5',] data[data[i].str.contains('', na=False)
Howdy, Stranger!
Categories
- 1.5K All Categories
- 6 XORMON NG
- 24 XORMON
- 123 LPAR2RRD
- 9 VMware
- 12 IBM i
- 1 oVirt / RHV
- 4 MS Windows and Hyper-V
- Solaris / OracleVM
- XenServer / Citrix
- Nutanix
- 6 Database
- 1 Cloud
- 9 Kubernetes / OpenShift / Docker
- 102 STOR2RRD
- 14 SAN
- 6 LAN
- 15 IBM
- 3 EMC
- 10 Hitachi
- 5 NetApp
- 13 HPE
- Lenovo
- 1 Huawei
- 1 Dell
- Fujitsu
- 2 DataCore
- INFINIDAT
- 3 Pure Storage
- Oracle