diff --git a/.travis.yml b/.travis.yml index 33c281b7f6d57..ee60f9d7ad713 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ install: - 'if [ $TRAVIS_PYTHON_VERSION == "3.3" ]; then pip uninstall numpy; pip install https://github.com/numpy/numpy/archive/v1.7.0b2.tar.gz; fi' - 'if [ $TRAVIS_PYTHON_VERSION == "3.2" ] || [ $TRAVIS_PYTHON_VERSION == "3.1" ]; then pip install https://github.com/y-p/numpy/archive/1.6.2_with_travis_fix.tar.gz; fi' - 'if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then pip install numpy; fi' # should be nop if pre-installed - - pip install --use-mirrors cython nose pytz python-dateutil; + - pip install --use-mirrors cython nose pytz python-dateutil xlrd openpyxl; script: - python setup.py build_ext install diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py index 401cc45cbdbd7..ac690c651249b 100644 --- a/pandas/tests/test_series.py +++ b/pandas/tests/test_series.py @@ -1446,7 +1446,6 @@ def test_append_many(self): assert_series_equal(result, self.ts) def test_all_any(self): - np.random.seed(12345) ts = tm.makeTimeSeries() bool_series = ts > 0 self.assert_(not bool_series.all()) diff --git a/pandas/tseries/index.py b/pandas/tseries/index.py index 92aeb1faf0ef5..b50ed318ee038 100644 --- a/pandas/tseries/index.py +++ b/pandas/tseries/index.py @@ -552,7 +552,8 @@ def _add_delta(self, delta): def __contains__(self, key): try: - return np.isscalar(self.get_loc(key)) + res = self.get_loc(key) + return np.isscalar(res) or type(res) == slice except (KeyError, TypeError): return False diff --git a/pandas/tseries/tests/test_timeseries.py b/pandas/tseries/tests/test_timeseries.py index ef35c44b53772..7db86a3e257f0 100644 --- a/pandas/tseries/tests/test_timeseries.py +++ b/pandas/tseries/tests/test_timeseries.py @@ -59,6 +59,11 @@ def test_index_unique(self): uniques = self.dups.index.unique() self.assert_(uniques.dtype == 'M8[ns]') # sanity + def test_index_dupes_contains(self): + d = datetime(2011, 12, 5, 20, 30) + ix=DatetimeIndex([d,d]) + self.assertTrue(d in ix) + def test_duplicate_dates_indexing(self): ts = self.dups