我试图从html
页面中提取特定的列,我的html
数据如下所示。在
1) HTML DATA Format
VM Name User Name Image Name Network VCPUS Memory(GB) Disk(GB) Tenant Region KVM Host Power State URL Created
0 dbsw-powerbi anokhe@ezy.com unknown {u'VLAN181': [u'192.168.57.91']} 4 16 100 APP DBS-AP-IN dbs-appkvm03 On https://compute.ezy.com 2018-08-02T10:30:07Z
1 pciedip anokhe@ezy.com dbsVDI-RHEL65 {u'VLAN181': [u'192.168.57.37']} 4 32 200 APP DBS-AP-IN dbs-appkvm01 On https://compute.ezy.com 2018-04-18T06:39:38Z
2 dbs-spbdatasync1 anokhe@ezy.com dbsVDI-RHEL510 {u'VLAN181': [u'192.168.57.156']} 1 8 50 APP DBS-AP-IN dbs-kvm13 On https://compute.ezy.com 2018-04-05T09:51:29Z
3 dbsw-russian anokhe@ezy.com dbsVDI-WIN764-V1 {u'VLAN181': [u'192.168.57.216']} 1 4 100 APP DBS-AP-IN dbs-appkvm01 On https://compute.ezy.com 2018-04-02T06:25:25Z
4 dbs-spbdatasync anokhe@ezy.com dbsVDI-RHEL510 {u'VLAN181': [u'192.168.57.233']} 1 8 50 APP DBS-AP-IN dbs-kvm13 On https://compute.ezy.com 2018-04-02T05:03:03Z
我只是尝试pandas read_html
来获取数据帧,但无法理解从数据帧中获取特定列。我需要从13列中选择['VM Name', 'User Name', 'Network', 'Region']
列。在
^{pr2}$2) code snippet
我在从已处理的
read_html
中选择DataFrame
并使用基于多索引的方法选择所需列时得到了解决方案。多亏了Adrew对这件事的想法。。在代码如下所示。。。可能对某人有帮助
选择可以使用的列的子集
相关问题 更多 >
编程相关推荐