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

Function test_cached_property

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

Source from the content-addressed store, hash-verified

299
300
301def test_cached_property() -> None:
302 # https://github.com/pandas-dev/pandas/pull/63439
303 # Ensure test is valid
304 assert isinstance(pd.Index.dtype, cache_readonly)
305
306 df = pd.DataFrame({"a": [1, 2, 3]})
307 expr = pd.col("a").index.dtype
308 expected_str = "col('a').index.dtype"
309 assert str(expr) == expected_str
310
311 result = df.assign(b=expr)
312 expected = pd.DataFrame({"a": [1, 2, 3], "b": np.int64})
313 tm.assert_frame_equal(result, expected)
314
315
316def test_qcut() -> None:

Callers

nothing calls this directly

Calls 2

assignMethod · 0.95
colMethod · 0.80

Tested by

no test coverage detected