Skip to content

Commit f7556be

Browse files
committed
testcase for pandas-dev#33168 code style changes
1 parent 4daed96 commit f7556be

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

pandas/tests/groupby/test_quantile.py

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -344,49 +344,51 @@ def test_columns_groupby_quantile():
344344

345345
tm.assert_frame_equal(result, expected)
346346

347+
347348
def test_timestamp_groupby_quantile():
348349
# GH 33168
349350
df = DataFrame(
350351
{
351-
'timestamp': pd.date_range(start='2020-04-19 00:00:00', freq='1T', periods=200, tz='UTC').floor('1H'),
352+
'timestamp': pd.date_range(start='2020-04-19 00:00:00',
353+
freq='1T', periods=200, tz='UTC').floor('1H'),
352354
'category': list(range(1, 201)),
353355
'value': list(range(201, 401))
354356
}
355357
)
356-
358+
357359
result = df.groupby('timestamp').quantile([0.1, 0.5, 0.9])
358-
360+
359361
expected = DataFrame(
360362
[
361-
{'category': 6.9, 'value': 206.9},
362-
{'category': 30.5, 'value': 230.5},
363-
{'category': 54.1, 'value': 254.1},
364-
{'category': 66.9, 'value': 266.9},
365-
{'category': 90.5, 'value': 290.5},
366-
{'category': 114.1, 'value': 314.1},
367-
{'category': 126.9, 'value': 326.9},
368-
{'category': 150.5, 'value': 350.5},
369-
{'category': 174.1, 'value': 374.1},
370-
{'category': 182.9, 'value': 382.9},
371-
{'category': 190.5, 'value': 390.5},
372-
{'category': 198.1, 'value': 398.1}
373-
],
363+
{'category': 6.9, 'value': 206.9},
364+
{'category': 30.5, 'value': 230.5},
365+
{'category': 54.1, 'value': 254.1},
366+
{'category': 66.9, 'value': 266.9},
367+
{'category': 90.5, 'value': 290.5},
368+
{'category': 114.1, 'value': 314.1},
369+
{'category': 126.9, 'value': 326.9},
370+
{'category': 150.5, 'value': 350.5},
371+
{'category': 174.1, 'value': 374.1},
372+
{'category': 182.9, 'value': 382.9},
373+
{'category': 190.5, 'value': 390.5},
374+
{'category': 198.1, 'value': 398.1}
375+
],
374376
index=pd.MultiIndex.from_tuples(
375377
[
376-
( pd.Timestamp('2020-04-19 00:00:00+00:00'), 0.1),
377-
( pd.Timestamp('2020-04-19 00:00:00+00:00'), 0.5),
378-
( pd.Timestamp('2020-04-19 00:00:00+00:00'), 0.9),
379-
( pd.Timestamp('2020-04-19 01:00:00+00:00'), 0.1),
380-
( pd.Timestamp('2020-04-19 01:00:00+00:00'), 0.5),
381-
( pd.Timestamp('2020-04-19 01:00:00+00:00'), 0.9),
382-
( pd.Timestamp('2020-04-19 02:00:00+00:00'), 0.1),
383-
( pd.Timestamp('2020-04-19 02:00:00+00:00'), 0.5),
384-
( pd.Timestamp('2020-04-19 02:00:00+00:00'), 0.9),
385-
( pd.Timestamp('2020-04-19 03:00:00+00:00'), 0.1),
386-
( pd.Timestamp('2020-04-19 03:00:00+00:00'), 0.5),
387-
( pd.Timestamp('2020-04-19 03:00:00+00:00'), 0.9)
378+
(pd.Timestamp('2020-04-19 00:00:00+00:00'), 0.1),
379+
(pd.Timestamp('2020-04-19 00:00:00+00:00'), 0.5),
380+
(pd.Timestamp('2020-04-19 00:00:00+00:00'), 0.9),
381+
(pd.Timestamp('2020-04-19 01:00:00+00:00'), 0.1),
382+
(pd.Timestamp('2020-04-19 01:00:00+00:00'), 0.5),
383+
(pd.Timestamp('2020-04-19 01:00:00+00:00'), 0.9),
384+
(pd.Timestamp('2020-04-19 02:00:00+00:00'), 0.1),
385+
(pd.Timestamp('2020-04-19 02:00:00+00:00'), 0.5),
386+
(pd.Timestamp('2020-04-19 02:00:00+00:00'), 0.9),
387+
(pd.Timestamp('2020-04-19 03:00:00+00:00'), 0.1),
388+
(pd.Timestamp('2020-04-19 03:00:00+00:00'), 0.5),
389+
(pd.Timestamp('2020-04-19 03:00:00+00:00'), 0.9)
388390
], names=('timestamp', None)
389391
)
390392
)
391-
393+
392394
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)