Skip to content

ENH: add dtype to read_xml #45341

@MehdiALLALA

Description

@MehdiALLALA

Is your feature request related to a problem?

pandas column type detection is not precise. for some columns the type in not the actual data type when reading xml files with read_xml.

Describe the solution you'd like

the solution is to add dtype option in the read_xml utility that will provide pandas with the wanted column types, this feature exists already with read_json, read_csv and many other utilities.

API breaking implications

this will make the read_xml utility detect the right type for each column. to keep the data in the correct format.

Describe alternatives you've considered

creating a script that will use the default pandas.DataFrame(......) constructor that contains dtype option to parse the xml file.
Capture6
Capture7

the loaded result from the read_xml is not the same as the xml file. the highlighted column is a string but pandas read it as an integer and with this the data is corrupted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions