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.6K All Categories
- 43 XORMON NG
- 25 XORMON
- 152 LPAR2RRD
- 13 VMware
- 16 IBM i
- 2 oVirt / RHV
- 4 MS Windows and Hyper-V
- Solaris / OracleVM
- XenServer / Citrix
- Nutanix
- 7 Database
- 2 Cloud
- 10 Kubernetes / OpenShift / Docker
- 122 STOR2RRD
- 19 SAN
- 7 LAN
- 17 IBM
- 3 EMC
- 12 Hitachi
- 5 NetApp
- 15 HPE
- Lenovo
- 1 Huawei
- 1 Dell
- Fujitsu
- 2 DataCore
- INFINIDAT
- 3 Pure Storage
- Oracle