How to open this XML file to create dataframe in Python?

前端 未结 3 560
不思量自难忘°
不思量自难忘° 2020-12-09 20:46

Does anyone have a suggestion for the best way to open the xml data on the site below to put it in a dataframe (I prefer working with pandas) in python? The file is on the

3条回答
  •  温柔的废话
    2020-12-09 21:39

    I would export the XLS formatted file to a CSV file (using a freely available program like Gnumeric or LibreOffice, or if you have it, Excel), and then read the CSV file into pandas. I know this is not exactly an answer to your final question, but parsing XML is an overly complicated solution to what you're trying to do.

    Regarding parsing XML in Python, the lxml library is my favorite library to use. I find using the XPath query language together with an lxml parser to be the best route.

提交回复
热议问题