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

Function test_map_box_dt64tz

pandas/tests/series/methods/test_map.py:458–467  ·  view source on GitHub ↗
(unit)

Source from the content-addressed store, hash-verified

456
457
458def test_map_box_dt64tz(unit):
459 vals = [
460 pd.Timestamp("2011-01-01", tz="US/Eastern"),
461 pd.Timestamp("2011-01-02", tz="US/Eastern"),
462 ]
463 ser = Series(vals).dt.as_unit(unit)
464 assert ser.dtype == f"datetime64[{unit}, US/Eastern]"
465 res = ser.map(lambda x: f"{type(x).__name__}_{x.day}_{x.tz}")
466 exp = Series(["Timestamp_1_US/Eastern", "Timestamp_2_US/Eastern"])
467 tm.assert_series_equal(res, exp)
468
469
470def test_map_box_td64(unit):

Callers

nothing calls this directly

Calls 3

SeriesClass · 0.90
as_unitMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected