@rplrpl/

XML to CSV 201904

Python

No description

fork
loading
Files
  • main.py
  • fleet_input.xml
main.py
1
2
3
4
5
import xml.etree.ElementTree
import pandas
car_details = [x.attrib for x in xml.etree.ElementTree.parse('fleet_input.xml').findall('Car')]
df = pandas.DataFrame.from_dict(car_details)
df.to_csv('fleet_output.csv', index=False)