File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ # -*- encoding: utf-8 -*-
2+
3+ """
4+ We test the describe_ndframe function.
5+ """
6+
7+ import pytest
8+ import numpy as np
9+
10+ from pandas .core .methods .describe import _refine_percentiles
11+
12+ def test_refine_percentiles ():
13+ """
14+ Check the performance of the _refine_percentiles when multiple
15+ values are passed.
16+ """
17+
18+ # by default 0.25, 0.50, 0.75 is returned
19+ # or, when None is passed return behavior is the same
20+ assert _refine_percentiles () == np .array ([0.25 , 0.5 , 0.75 ])
21+ assert _refine_percentiles (percentiles = None ) == np .array ([0.25 , 0.5 , 0.75 ])
22+
23+ # when any value is passed, then the function should return
24+ percentiles_ = [0.3 , 0.6 ]
25+ assert _refine_percentiles (percentiles_ ) == np .array (percentiles_ )
26+
27+ # when a blank list is passed, then should return only 0.5
28+ assert _refine_percentiles (percentiles = []) == np .array ([0.5 ])
You can’t perform that action at this time.
0 commit comments