Python Forum

Full Version: Trouble reading Excel file.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have an excel file that I want to read in pandas.

My code is:
pd.read_excel(r'file:///C:\Users\srodger\Desktop\amg-20200301132033.xlsx')
    print(df)
Output:
<?xml version="1.0"?> 0 <pwx xmlns:xsd="http://www.w3.org/2001/XMLSche... 1 <workout> 2 <goal>CdA Testing for Campbell and Nick</g... 3 <sportType>Bike</sportType> 4 <title>Track Session (1-4pm)</title> ... ... 30628 <cad>14</cad> 30629 <dist>3564.7490234375</dist> 30630 </sample> 30631 </workout> 30632 </pwx> [30633 rows x 1 columns]
I believe the output that I am getting is an XML. I am confused, why would this be the case and how can I read this file in a pandas dataframe?? I have tried to follow blogs to get xml into pandas but have not been able to get the code to work.

Thanks - your help is appreciated!!
have you checked the excel file to see if it's valid?
I got there... It took me a long time to try it but when i restarted the kernel in Jupyter labs it worked.


Thanks Shem