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

Method test_diff_tz

pandas/tests/series/methods/test_diff.py:37–54  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

35 assert result[1] == 1
36
37 def test_diff_tz(self):
38 # Combined datetime diff, normal diff and boolean diff test
39 ts = Series(
40 np.arange(10, dtype=np.float64),
41 index=date_range("2020-01-01", periods=10),
42 name="ts",
43 )
44 ts.diff()
45
46 # neg n
47 result = ts.diff(-1)
48 expected = ts - ts.shift(-1)
49 tm.assert_series_equal(result, expected)
50
51 # 0
52 result = ts.diff(0)
53 expected = ts - ts
54 tm.assert_series_equal(result, expected)
55
56 def test_diff_dt64(self):
57 # datetime diff (GH#3100)

Callers

nothing calls this directly

Calls 4

diffMethod · 0.95
SeriesClass · 0.90
date_rangeFunction · 0.90
shiftMethod · 0.45

Tested by

no test coverage detected