XML
eXtensible Markup Language
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>
Load XML
We can load the data by the read_xml()
method. It parses the information directly in a DataFrame format
import pandas as pd
df = pd.read_xml('https://bioinf.nl/~fennaf/DSLS/plants.xml')
df.head()

Last updated
Was this helpful?