I'm trying to read in a .xlsx file into a dataframe. The .xlsx opened in Excel looks like:
Heading 1 | Heading 2 | Heading 3 |
---|---|---|
soda | 12 | 4 |
pop | 12 | 2 |
cola | 12 | 3 |
But the dataframe I read in using:
df = pd.read_excel("fileName.xlsx", engine='openpyxl')
looks like this:
Heading 1 | Heading 2 | Heading 3 |
---|---|---|
soda | 0 | 4 |
pop | 0 | 2 |
cola | 0 | 3 |
Does anyone know why all the values in the second heading are replaced with 0? Or any way I could get around it? I'm not sure considering that the standard read_csv no longer supports .xlsx so I've been using the Openpyxl version. Thanks in advance!
EDIT: So xlrd no longer supports .xlsx either (only .xls) so I installed an older version of xlrd, but I get the same result as seen above using an older version of xlrd as I do using the current version of openpyxl. Still looking for help...
Also I meant to say read_excel in place of read_csv