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

Method __init__

pandas/io/stata.py:698–712  ·  view source on GitHub ↗
(
        self,
        labname: str,
        value_labels: dict[float, str],
        encoding: Literal["latin-1", "utf-8"] = "latin-1",
    )

Source from the content-addressed store, hash-verified

696 """
697
698 def __init__(
699 self,
700 labname: str,
701 value_labels: dict[float, str],
702 encoding: Literal["latin-1", "utf-8"] = "latin-1",
703 ) -> None:
704 if encoding not in ("latin-1", "utf-8"):
705 raise ValueError("Only latin-1 and utf-8 are supported.")
706
707 self.labname = labname
708 self._encoding = encoding
709 self.value_labels = sorted( # type: ignore[assignment]
710 value_labels.items(), key=lambda x: x[0]
711 )
712 self._prepare_value_labels()
713
714
715class StataMissingValue:

Callers

nothing calls this directly

Calls 2

_prepare_value_labelsMethod · 0.80
itemsMethod · 0.45

Tested by

no test coverage detected