|
22 | 22 | import pandas.core.datetools as datetools
|
23 | 23 | import pandas as pd
|
24 | 24 | import numpy as np
|
25 |
| -from pandas.compat import range, lrange, lmap, map, zip |
26 |
| -randn = np.random.randn |
| 25 | +from numpy.random import randn |
| 26 | +from pandas.compat import range, lrange, lmap, zip |
27 | 27 |
|
28 | 28 | from pandas import Series, TimeSeries, DataFrame
|
29 | 29 | from pandas.util.testing import(assert_series_equal, assert_almost_equal,
|
@@ -1207,7 +1207,6 @@ def test_is_(self):
|
1207 | 1207 | self.assertFalse(index.is_(index - 2))
|
1208 | 1208 | self.assertFalse(index.is_(index - 0))
|
1209 | 1209 |
|
1210 |
| - |
1211 | 1210 | def test_comp_period(self):
|
1212 | 1211 | idx = period_range('2007-01', periods=20, freq='M')
|
1213 | 1212 |
|
@@ -1913,6 +1912,17 @@ def test_join_self(self):
|
1913 | 1912 | res = index.join(index, how=kind)
|
1914 | 1913 | self.assert_(index is res)
|
1915 | 1914 |
|
| 1915 | + def test_join_does_not_recur(self): |
| 1916 | + df = tm.makeCustomDataframe(3, 2, data_gen_f=lambda *args: |
| 1917 | + np.random.randint(2), c_idx_type='p', |
| 1918 | + r_idx_type='dt') |
| 1919 | + s = df.iloc[:2, 0] |
| 1920 | + |
| 1921 | + res = s.index.join(df.columns, how='outer') |
| 1922 | + expected = Index([s.index[0], s.index[1], |
| 1923 | + df.columns[0], df.columns[1]], object) |
| 1924 | + np.testing.assert_array_equal(res, expected) |
| 1925 | + |
1916 | 1926 | def test_align_series(self):
|
1917 | 1927 | rng = period_range('1/1/2000', '1/1/2010', freq='A')
|
1918 | 1928 | ts = Series(np.random.randn(len(rng)), index=rng)
|
@@ -2185,15 +2195,15 @@ def test_minutely(self):
|
2185 | 2195 |
|
2186 | 2196 | def test_secondly(self):
|
2187 | 2197 | self._check_freq('S', '1970-01-01')
|
2188 |
| - |
| 2198 | + |
2189 | 2199 | def test_millisecondly(self):
|
2190 | 2200 | self._check_freq('L', '1970-01-01')
|
2191 | 2201 |
|
2192 | 2202 | def test_microsecondly(self):
|
2193 | 2203 | self._check_freq('U', '1970-01-01')
|
2194 |
| - |
| 2204 | + |
2195 | 2205 | def test_nanosecondly(self):
|
2196 |
| - self._check_freq('N', '1970-01-01') |
| 2206 | + self._check_freq('N', '1970-01-01') |
2197 | 2207 |
|
2198 | 2208 | def _check_freq(self, freq, base_date):
|
2199 | 2209 | rng = PeriodIndex(start=base_date, periods=10, freq=freq)
|
|
0 commit comments