()
| 314 | |
| 315 | |
| 316 | def 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 | |
| 328 | def test_where() -> None: |