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

Function test_clip_axis_1

dask/dataframe/tests/test_dataframe.py:768–784  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

766
767
768def test_clip_axis_1():
769 df = pd.DataFrame(
770 {
771 "a": [1, 2, 3, 4, 5, 6, 7, 8, 9],
772 "b": [3, 5, 2, 5, 7, 2, 4, 2, 4],
773 }
774 )
775 ddf = dd.from_pandas(df, 3)
776 l = pd.Series({"a": 2, "b": 3})
777 u = pd.Series({"a": 7, "b": 5})
778
779 assert_eq(ddf.clip(lower=l, upper=u, axis=1), df.clip(lower=l, upper=u, axis=1))
780 assert_eq(ddf.clip(lower=l, axis=1), df.clip(lower=l, axis=1))
781 assert_eq(ddf.clip(upper=u, axis=1), df.clip(upper=u, axis=1))
782
783 with pytest.raises(ValueError, match="No axis named 1 for Series"):
784 ddf.a.clip(lower=l, upper=u, axis=1)
785
786
787def test_squeeze():

Callers

nothing calls this directly

Calls 3

clipMethod · 0.95
assert_eqFunction · 0.90
clipMethod · 0.45

Tested by

no test coverage detected