Skip to content

Instantly share code, notes, and snippets.

@Elfsong Elfsong/excel_reader
Created Jan 26, 2019

Embed
What would you like to do?
Excel Reader #spreadsheet #python
import os
import xlrd
ROOT_PATH = r"C:\Users\t-midu\PycharmProjects\Scenario"
RESOURCE_PATH = os.path.join(ROOT_PATH, "resource")
file_path = os.path.join(RESOURCE_PATH, "sentence_class.xls")
data = xlrd.open_workbook(file_path)
table = data.sheet_by_name('label')
nrows = table.nrows
for line in range(15, nrows):
print(table.row_values(line))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.