MCPcopy
hub / github.com/pandas-dev/pandas / preprocess_data

Function preprocess_data

pandas/io/xml.py:705–722  ·  view source on GitHub ↗

Convert extracted raw data. This method will return underlying data of extracted XML content. The data either has a `read` attribute (e.g. a file object or a StringIO/BytesIO) or is a string or bytes that is an XML document.

(
    data: str | bytes | io.StringIO | io.BytesIO,
)

Source from the content-addressed store, hash-verified

703
704
705def preprocess_data(
706 data: str | bytes | io.StringIO | io.BytesIO,
707) -> io.StringIO | io.BytesIO:
708 """
709 Convert extracted raw data.
710
711 This method will return underlying data of extracted XML content.
712 The data either has a `read` attribute (e.g. a file object or a
713 StringIO/BytesIO) or is a string or bytes that is an XML document.
714 """
715
716 if isinstance(data, str):
717 data = io.StringIO(data)
718
719 elif isinstance(data, bytes):
720 data = io.BytesIO(data)
721
722 return data
723
724
725def _data_to_frame(data: list[dict[str, str | None]], **kwargs) -> DataFrame:

Callers 1

get_data_from_filepathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected