MCPcopy Create free account
hub / github.com/dask/dask / _validate_axis

Function _validate_axis

dask/dataframe/dask_expr/_util.py:60–68  ·  view source on GitHub ↗
(axis=0, none_is_zero: bool = True)

Source from the content-addressed store, hash-verified

58
59
60def _validate_axis(axis=0, none_is_zero: bool = True) -> None | Literal[0, 1]:
61 if axis not in (0, 1, "index", "columns", None):
62 raise ValueError(f"No axis named {axis}")
63 # convert to numeric axis
64 numeric_axis: dict[str | None, Literal[0, 1]] = {"index": 0, "columns": 1}
65 if none_is_zero:
66 numeric_axis[None] = 0
67
68 return numeric_axis.get(axis, axis)
69
70
71def _convert_to_list(column) -> list | None:

Callers 6

methodFunction · 0.90
ffillMethod · 0.90
bfillMethod · 0.90
shiftMethod · 0.90
diffMethod · 0.90
dropMethod · 0.90

Calls 1

getMethod · 0.45

Tested by

no test coverage detected