eXtensible Markup Language
Last updated 3 years ago
Was this helpful?
XML is another common structured data format supporting hierarchal nested data with metadata. XML and HTML are structured similar but XML is more general. An example of XML is given below:
<CATALOG> <PLANT> <COMMON>Bloodroot</COMMON> <BOTANICAL>Sanguinaria canadensis</BOTANICAL> <ZONE>4</ZONE> <LIGHT>Mostly Shady</LIGHT> <PRICE>$2.44</PRICE> <AVAILABILITY>031599</AVAILABILITY> </PLANT>
We can load the data by the read_xml() method. It parses the information directly in a DataFrame format
read_xml()
import pandas as pd df = pd.read_xml('https://bioinf.nl/~fennaf/DSLS/plants.xml') df.head()