We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 355e569 commit ac919cfCopy full SHA for ac919cf
pandas/tools/tests/test_tile.py
@@ -313,6 +313,18 @@ def test_datetime_cut(self):
313
result, bins = cut(data, 3, retbins=True)
314
tm.assert_series_equal(Series(result), expected)
315
316
+ def test_datetime_bin(self):
317
+ data = [np.datetime64('2012-12-13'), np.datetime64('2012-12-15')]
318
+ bins = [np.datetime64('2012-12-12'), np.datetime64('2012-12-14'),
319
+ np.datetime64('2012-12-16')]
320
+ result = cut(data, bins=bins)
321
+
322
+ expected = Series(['(2012-12-12 00:00:00, 2012-12-14 00:00:00]',
323
+ '(2012-12-14 00:00:00, 2012-12-16 00:00:00]'],
324
+ ).astype("category", ordered=True)
325
326
+ tm.assert_series_equal(Series(result), expected)
327
328
329
def curpath():
330
pth, _ = os.path.split(os.path.abspath(__file__))
0 commit comments