|
17 | 17 |
|
18 | 18 |
|
19 | 19 | class TestDatetimeIndex:
|
20 |
| - def test_time_loc(self): # GH8667 |
21 |
| - from datetime import time |
22 |
| - |
23 |
| - from pandas._libs.index import _SIZE_CUTOFF |
24 |
| - |
25 |
| - ns = _SIZE_CUTOFF + np.array([-100, 100], dtype=np.int64) |
26 |
| - key = time(15, 11, 30) |
27 |
| - start = key.hour * 3600 + key.minute * 60 + key.second |
28 |
| - step = 24 * 3600 |
29 |
| - |
30 |
| - for n in ns: |
31 |
| - idx = date_range("2014-11-26", periods=n, freq="S") |
32 |
| - ts = pd.Series(np.random.randn(n), index=idx) |
33 |
| - i = np.arange(start, n, step) |
34 |
| - |
35 |
| - tm.assert_numpy_array_equal(ts.index.get_loc(key), i, check_dtype=False) |
36 |
| - tm.assert_series_equal(ts[key], ts.iloc[i]) |
37 |
| - |
38 |
| - left, right = ts.copy(), ts.copy() |
39 |
| - left[key] *= -10 |
40 |
| - right.iloc[i] *= -10 |
41 |
| - tm.assert_series_equal(left, right) |
42 |
| - |
43 | 20 | def test_time_overflow_for_32bit_machines(self):
|
44 | 21 | # GH8943. On some machines NumPy defaults to np.int32 (for example,
|
45 | 22 | # 32-bit Linux machines). In the function _generate_regular_range
|
@@ -78,13 +55,6 @@ def test_week_of_month_frequency(self):
|
78 | 55 | expected = DatetimeIndex(dates, freq="WOM-1SAT")
|
79 | 56 | tm.assert_index_equal(result, expected)
|
80 | 57 |
|
81 |
| - def test_stringified_slice_with_tz(self): |
82 |
| - # GH#2658 |
83 |
| - start = "2013-01-07" |
84 |
| - idx = date_range(start=start, freq="1d", periods=10, tz="US/Eastern") |
85 |
| - df = DataFrame(np.arange(10), index=idx) |
86 |
| - df["2013-01-14 23:44:34.437768-05:00":] # no exception here |
87 |
| - |
88 | 58 | def test_append_nondatetimeindex(self):
|
89 | 59 | rng = date_range("1/1/2000", periods=10)
|
90 | 60 | idx = Index(["a", "b", "c", "d"])
|
@@ -137,16 +107,6 @@ def test_misc_coverage(self):
|
137 | 107 | result = rng.groupby(rng.day)
|
138 | 108 | assert isinstance(list(result.values())[0][0], Timestamp)
|
139 | 109 |
|
140 |
| - def test_string_index_series_name_converted(self): |
141 |
| - # #1644 |
142 |
| - df = DataFrame(np.random.randn(10, 4), index=date_range("1/1/2000", periods=10)) |
143 |
| - |
144 |
| - result = df.loc["1/3/2000"] |
145 |
| - assert result.name == df.index[2] |
146 |
| - |
147 |
| - result = df.T["1/3/2000"] |
148 |
| - assert result.name == df.index[2] |
149 |
| - |
150 | 110 | def test_groupby_function_tuple_1677(self):
|
151 | 111 | df = DataFrame(np.random.rand(100), index=date_range("1/1/2000", periods=100))
|
152 | 112 | monthly_group = df.groupby(lambda x: (x.year, x.month))
|
|
0 commit comments