|
7 | 7 | from pandas import (
|
8 | 8 | Index,
|
9 | 9 | Int64Index,
|
| 10 | + NaT, |
10 | 11 | Series,
|
11 | 12 | Timedelta,
|
12 | 13 | TimedeltaIndex,
|
13 |
| - date_range, |
14 | 14 | timedelta_range,
|
15 | 15 | )
|
16 | 16 | import pandas._testing as tm
|
@@ -42,26 +42,6 @@ def test_numeric_compat(self):
|
42 | 42 | def test_shift(self):
|
43 | 43 | pass # this is handled in test_arithmetic.py
|
44 | 44 |
|
45 |
| - def test_pickle_after_set_freq(self): |
46 |
| - tdi = timedelta_range("1 day", periods=4, freq="s") |
47 |
| - tdi = tdi._with_freq(None) |
48 |
| - |
49 |
| - res = tm.round_trip_pickle(tdi) |
50 |
| - tm.assert_index_equal(res, tdi) |
51 |
| - |
52 |
| - def test_isin(self): |
53 |
| - |
54 |
| - index = tm.makeTimedeltaIndex(4) |
55 |
| - result = index.isin(index) |
56 |
| - assert result.all() |
57 |
| - |
58 |
| - result = index.isin(list(index)) |
59 |
| - assert result.all() |
60 |
| - |
61 |
| - tm.assert_almost_equal( |
62 |
| - index.isin([index[2], 5]), np.array([False, False, True, False]) |
63 |
| - ) |
64 |
| - |
65 | 45 | def test_misc_coverage(self):
|
66 | 46 |
|
67 | 47 | rng = timedelta_range("1 day", periods=5)
|
@@ -140,11 +120,11 @@ def test_freq_conversion(self):
|
140 | 120 | # doc example
|
141 | 121 |
|
142 | 122 | # series
|
143 |
| - td = Series(date_range("20130101", periods=4)) - Series( |
144 |
| - date_range("20121201", periods=4) |
| 123 | + scalar = Timedelta(days=31) |
| 124 | + td = Series( |
| 125 | + [scalar, scalar, scalar + timedelta(minutes=5, seconds=3), NaT], |
| 126 | + dtype="m8[ns]", |
145 | 127 | )
|
146 |
| - td[2] += timedelta(minutes=5, seconds=3) |
147 |
| - td[3] = np.nan |
148 | 128 |
|
149 | 129 | result = td / np.timedelta64(1, "D")
|
150 | 130 | expected = Series([31, 31, (31 * 86400 + 5 * 60 + 3) / 86400.0, np.nan])
|
|
0 commit comments