Skip to content

Commit af29e41

Browse files
committed
unit tests
1 parent ffc49d7 commit af29e41

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

pandas/core/tests/test_frame.py

+17-2
Original file line numberDiff line numberDiff line change
@@ -1649,11 +1649,21 @@ def f(x):
16491649

16501650
self._check_statistic(self.frame, 'skew', f)
16511651

1652+
def test_quantile(self):
1653+
try:
1654+
from scipy.stats import scoreatpercentile
1655+
except ImportError:
1656+
return
1657+
1658+
q = self.tsframe.quantile(0.1, axis=0)
1659+
self.assertEqual(q['A'], scoreatpercentile(self.tsframe['A'], 10))
1660+
q = self.tsframe.quantile(0.9, axis=1)
1661+
q = self.intframe.quantile(0.1)
1662+
self.assertEqual(q['A'], scoreatpercentile(self.intframe['A'], 10))
1663+
16521664
def test_cumsum(self):
16531665
cumsum = self.tsframe.cumsum()
1654-
16551666
assert_series_equal(cumsum['A'], np.cumsum(self.tsframe['A'].fillna(0)))
1656-
16571667
df = self.klass({'A' : np.arange(20)}, index=np.arange(20))
16581668

16591669
# works
@@ -1673,6 +1683,11 @@ def test_cumprod(self):
16731683
cumprod_xs = self.tsframe.cumprod(axis=1)
16741684
self.assertEqual(np.shape(cumprod_xs), np.shape(self.tsframe))
16751685

1686+
def test_describe(self):
1687+
desc = self.tsframe.describe()
1688+
desc = self.mixed_frame.describe()
1689+
desc = self.frame.describe()
1690+
16761691
if __name__ == '__main__':
16771692
unittest.main()
16781693

0 commit comments

Comments
 (0)