Reading a simple xls returning empty dataframe, can't figure it out for the life of me:
path = ('c:/Users/Desktop/Stuff/Ready')
files = os.listdir(path)
print(files)
files_xlsx = [f for f in files if f[-3:] == 'xlsx']
readyorders = pd.DataFrame()
for filename in files_xlsx:
with open(os.path.join(path, filename)) as f:
data = pd.read_excel(f)
readyorders = readyorders.append(data)
print(readyorders)
The excel is just two simple columns...is it just too early in the day?
I had a similar issue and it turns out that there are TWO types of XLSX: "Excel Workbook" (at the top of the list in the image below) and "Strict Open XML Spreadsheet" (with the checkmark). The latter returns an empty spreadsheet in pandas, so use the Excel Workbook (.xlsx) and you won't have problems.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With