0

I am trying to read a xml file using python. I am using jupyter to run the code, when I run it, the pc gets stuck (it does not response, it dows not show any error). The xml file is in the same folder as my jupyter notebook.

The file has more than 250000 rows and 150 columns

import xml.etree.ElementTree as ET


mytree = ET.parse('NameFile.xml')
myroot = mytree.getroot()
print(myroot)
  • 3
    what do you mean by "stuck" ? Can you show the traceback – ludel Jun 05 '20 at 17:04
  • please share NameFile.xml and explain the problem – balderman Jun 07 '20 at 10:42
  • I dont know if it is relevant but I created the xml using Excel, and file has more than 250000 rows. – Laura Martinez Jun 14 '20 at 09:22
  • I dont know if it is relevant but I created the xml using Excel, and file has more than 250000 rows. @ludel When I said "stuck", I meant the computer does not respond, it does not even show any error. I tried with a smaller file, but it didnot work either. – Laura Martinez Jun 14 '20 at 09:28
  • Does this answer your question? [What is the fastest way to parse large XML docs in Python?](https://stackoverflow.com/questions/324214/what-is-the-fastest-way-to-parse-large-xml-docs-in-python) – fafl Jun 14 '20 at 10:38

0 Answers0