diff --git a/pandas/core/series.py b/pandas/core/series.py index 7d7153668b3d4..2923f4b8436fd 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -1603,7 +1603,7 @@ def to_csv(self, path): path : string or None Output filepath. If None, write to stdout """ - f = open(path, 'wb') + f = open(path, 'w') csvout = csv.writer(f) csvout.writerows(self.iteritems()) f.close() @@ -1619,6 +1619,9 @@ def dropna(self): return remove_na(self) valid = dropna + + isnull = isnull + notnull = notnull def first_valid_index(self): """ diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py index c1c38cb392e46..de4a98656546f 100644 --- a/pandas/tests/test_series.py +++ b/pandas/tests/test_series.py @@ -824,6 +824,18 @@ def test_valid(self): self.assertEqual(len(result), ts.count()) common.assert_dict_equal(result, ts, compare_keys=False) + + def test_isnull(self): + ser = Series([0,5.4,3,nan,-0.001]) + assert_series_equal(ser.isnull(), Series([False,False,False,True,False])) + ser = Series(["hi","",nan]) + assert_series_equal(ser.isnull(), Series([False,False,True])) + + def test_notnull(self): + ser = Series([0,5.4,3,nan,-0.001]) + assert_series_equal(ser.notnull(), Series([True,True,True,False,True])) + ser = Series(["hi","",nan]) + assert_series_equal(ser.notnull(), Series([True,True,False])) def test_shift(self): shifted = self.ts.shift(1) diff --git a/setup.py b/setup.py index cbcf938719c00..5a8df7f28c0f3 100755 --- a/setup.py +++ b/setup.py @@ -113,6 +113,8 @@ 'Operating System :: OS Independent', 'Intended Audience :: Science/Research', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', 'Programming Language :: Cython', 'Topic :: Scientific/Engineering', ]