INNER CODE UNIT · Python
_split_string
aeturrell/skimpy · src/skimpy/__init__.py:1016
def _split_string(string: str) -> list[str]:
"""Split the string into separate words."""
string = re.sub(r"[\-_]", " ", string)
return re.sub(r"([A-Z][a-z]+)", r" \1", re.sub(r"([A-Z]+)", r"\1", string)).split()
@typechecked
def _replace_values(name: Any, mapping: dict[str, str]) -> Any:
"""_summary_
Args:
name (Any): Column name.
mapping (dict[str, str]): Maps old values in the column name to the new values.
Returns:
Any: Re-mapped column name.
"""