| 101 | |
| 102 | |
| 103 | def test_matmul(): |
| 104 | # https://github.com/pandas-dev/pandas/pull/64267 |
| 105 | df = pd.DataFrame({"a": [1, 2]}) |
| 106 | |
| 107 | expr = pd.col("a") @ [3, 4] |
| 108 | result = df.assign(c=expr) |
| 109 | expected = pd.DataFrame({"a": [1, 2], "c": [11, 11]}) |
| 110 | tm.assert_frame_equal(result, expected) |
| 111 | assert str(expr) == "col('a') @ [3, 4]" |
| 112 | |
| 113 | expr = [3, 4] @ pd.col("a") |
| 114 | result = df.assign(c=expr) |
| 115 | expected = pd.DataFrame({"a": [1, 2], "c": [11, 11]}) |
| 116 | tm.assert_frame_equal(result, expected) |
| 117 | assert str(expr) == "[3, 4] @ col('a')" |
| 118 | |
| 119 | |
| 120 | def test_frame_getitem() -> None: |