milenko
milenko

Reputation: 31

Reading xls file with Python

import xlrd
cord = xlrd.open_workbook('MT_coordenadas_todas.xls')

id = cord.sheet_by_index(0)
print id

When I run my code in terminal,I got

<xlrd.sheet.Sheet object at 0x7f897e3ecf90>

I wanted to take the first column,so what should I change in my code?

Upvotes: 0

Views: 80

Answers (1)

Oli
Oli

Reputation: 415

id is a reference to the sheet object. You need to use values = id.col_values(0) to read the values from the first column of that sheet.

Upvotes: 1

Related Questions