2
我的Excel數據是這樣的:如何通過列名提取excel數據?
A B C
1 123 534 576
2 456 745 345
3 234 765 285
在另一個excel表格,我的數據可能看起來像這樣:
B C A
1 123 534 576
2 456 745 345
3 234 765 285
如何從兩個電子表格中提取C列的內容是什麼?
我的代碼如下:
#Open the workbook
ow = xlrd.open_workbook('export.xlsx').sheet_by_index(0)
#Store column 3's data inside an array
ips = ow.col_values(2, 1)
我想更多的東西一樣:ips = ow.col_values(C, 1)
我怎樣才能實現上述?
[從Excel中使用Python提取列]的可能的複製(http://stackoverflow.com/questions/14931906/extract-columns-from-excel-using- python) –
另外,看看@Harilal Remesan答案[這裏](http://stackoverflow.com/questions/34754077/openpyxl-read-only-one-column-from-excel-file-in-python)那可能有幫助! –
您是否嘗試將2分配給'''C'''? '''xlrd'''不使用* alpha *列引用。 – wwii