Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble reading Excel file.
#1
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!!
Reply
#2
have you checked the excel file to see if it's valid?
Reply
#3
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python openyxl not updating Excel file MrBean12 1 328 Mar-03-2024, 12:16 AM
Last Post: MrBean12
  Copy Paste excel files based on the first letters of the file name Viento 2 437 Feb-07-2024, 12:24 PM
Last Post: Viento
Sad problems with reading csv file. MassiJames 3 632 Nov-16-2023, 03:41 PM
Last Post: snippsat
  Search Excel File with a list of values huzzug 4 1,242 Nov-03-2023, 05:35 PM
Last Post: huzzug
  Updating sharepoint excel file odd results cubangt 1 832 Nov-03-2023, 05:13 PM
Last Post: noisefloor
  trouble reading string/module from excel as a list popular_dog 0 424 Oct-04-2023, 01:07 PM
Last Post: popular_dog
  Reading a file name fron a folder on my desktop Fiona 4 916 Aug-23-2023, 11:11 AM
Last Post: Axel_Erfurt
  Trouble with threading and reading variable from a different script Lembas 14 3,037 Apr-26-2023, 11:21 PM
Last Post: Lembas
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,102 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  Save and Close Excel File avd88 0 3,046 Feb-20-2023, 07:19 PM
Last Post: avd88

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020