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

Method __init__

pandas/io/stata.py:581–591  ·  view source on GitHub ↗
(
        self, catarray: Series, encoding: Literal["latin-1", "utf-8"] = "latin-1"
    )

Source from the content-addressed store, hash-verified

579 """
580
581 def __init__(
582 self, catarray: Series, encoding: Literal["latin-1", "utf-8"] = "latin-1"
583 ) -> None:
584 if encoding not in ("latin-1", "utf-8"):
585 raise ValueError("Only latin-1 and utf-8 are supported.")
586 self.labname = catarray.name
587 self._encoding = encoding
588 categories = catarray.cat.categories
589 self.value_labels = enumerate(categories)
590
591 self._prepare_value_labels()
592
593 def _prepare_value_labels(self) -> None:
594 """Encode value labels."""

Callers

nothing calls this directly

Calls 1

_prepare_value_labelsMethod · 0.95

Tested by

no test coverage detected