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

Function test_qcut

pandas/tests/test_col.py:316–325  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

314
315
316def test_qcut() -> None:
317 # https://github.com/pandas-dev/pandas/pull/63439
318 df = pd.DataFrame({"a": [1, 2, 3]})
319 expr = pd.qcut(pd.col("a"), 3)
320 expected_str = "qcut(x=col('a'), q=3, labels=None, retbins=False, precision=3)"
321 assert str(expr) == expected_str, str(expr)
322
323 result = df.assign(b=expr)
324 expected = pd.DataFrame({"a": [1, 2, 3], "b": pd.qcut(df["a"], 3)})
325 tm.assert_frame_equal(result, expected)
326
327
328def test_where() -> None:

Callers

nothing calls this directly

Calls 2

assignMethod · 0.95
colMethod · 0.80

Tested by

no test coverage detected