We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 070943a commit 7567fffCopy full SHA for 7567fff
RELEASE.rst
@@ -55,6 +55,7 @@ pandas 0.8.0
55
DataFrame (#929, #1241)
56
- Add 'kde' plot kind for Series/DataFrame.plot (#1059)
57
- More flexible multiple function aggregation with GroupBy
58
+ - Add pct_chagne function
59
60
**Improvements to existing features**
61
pandas/tests/test_index.py
@@ -679,6 +679,20 @@ def test_join_non_int_index(self):
679
right2 = other.join(self.index, how='right')
680
self.assert_(right2.equals(self.index))
681
682
+ def test_join_non_unique(self):
683
+ left = Index([4, 4, 3, 3])
684
+
685
+ joined, lidx, ridx = left.join(left, return_indexers=True)
686
687
+ exp_joined = Index([3, 3, 3, 3, 4, 4, 4, 4])
688
+ self.assert_(joined.equals(exp_joined))
689
690
+ exp_lidx = np.array([2, 2, 3, 3, 0, 0, 1, 1], dtype=np.int64)
691
+ self.assert_(np.array_equal(lidx, exp_lidx))
692
693
+ exp_ridx = np.array([2, 3, 2, 3, 0, 1, 0, 1], dtype=np.int64)
694
+ self.assert_(np.array_equal(ridx, exp_ridx))
695
696
def test_intersection(self):
697
other = Index([1, 2, 3, 4, 5])
698
result = self.index.intersection(other)
pandas/tests/test_series.py
@@ -2673,9 +2673,9 @@ def test_pct_change(self):
2673
filled = self.ts.fillna(method='bfill', limit=1)
2674
assert_series_equal(rs, filled / filled.shift(1) - 1)
2675
2676
- # rs = self.ts.pct_change(freq='M')
2677
- # filled = self.ts.fillna(method='pad')
2678
- # assert_series_equal(rs, filled / filled.shift(freq='M') - 1)
+ rs = self.ts.pct_change(freq='5D')
+ filled = self.ts.fillna(method='pad')
+ assert_series_equal(rs, filled / filled.shift(freq='5D') - 1)
2679
2680
def test_pct_change_shift_over_nas(self):
2681
s = Series([1., 1.5, np.nan, 2.5, 3.])
0 commit comments