0

Openpyxl would do the job but I'm just wondering if there is a way to do it in pandas or maybe converting a Openpyxl workbook into pandas dataframe? Thank you guys.

edit: I found the doc for Openpyxl and tried to do the following …

ws = wb.worksheets[0]
data = ws.values
col = next(data)[1:]    #error occurred here

The issue for this script is that xltx file consists of several merged cells. Error message: 'MergedCell' object has no attribute 'value'

1 Answers1

0

There's a method for that.

import pandas as pd
df = pd.read_excel('filename.xltx')

df will be your dataframe. Read all the options here.

run-out
  • 3,114
  • 1
  • 9
  • 25