diff --git a/doc/source/10min.rst b/doc/source/10min.rst index cbd2f60ddbcd3..438f812039fa6 100644 --- a/doc/source/10min.rst +++ b/doc/source/10min.rst @@ -291,12 +291,10 @@ Using the :func:`~Series.isin` method for filtering: .. ipython:: python - df['E']=['one', 'one','two','three','four','three'] - df - good_numbers=['two','four'] - df[df['E'].isin(good_numbers)] - - df.drop('E', inplace=True, axis=1) + df2 = df.copy() + df2['E']=['one', 'one','two','three','four','three'] + df2 + df2[df2['E'].isin(['two','four']) Setting ~~~~~~~ diff --git a/pandas/io/stata.py b/pandas/io/stata.py index 75aaf68b4dd0a..187a5f5d55533 100644 --- a/pandas/io/stata.py +++ b/pandas/io/stata.py @@ -99,7 +99,7 @@ def _stata_elapsed_date_to_datetime(date, fmt): #TODO: IIRC relative delta doesn't play well with np.datetime? #TODO: When pandas supports more than datetime64[ns], this should be improved to use correct range, e.g. datetime[Y] for yearly if np.isnan(date): - return np.datetime64('nat') + return NaT date = int(date) stata_epoch = datetime.datetime(1960, 1, 1) diff --git a/pandas/tseries/tests/test_timeseries.py b/pandas/tseries/tests/test_timeseries.py index 6b235b0d6b665..0bdcff58a0b30 100644 --- a/pandas/tseries/tests/test_timeseries.py +++ b/pandas/tseries/tests/test_timeseries.py @@ -2705,7 +2705,7 @@ def test_class_ops(self): import pytz def compare(x,y): - self.assertEqual(int(Timestamp(x).value/1e9), int(Timestamp(y).value/1e9)) + self.assertEqual(int(np.round(Timestamp(x).value/1e9)), int(np.round(Timestamp(y).value/1e9))) compare(Timestamp.now(),datetime.now()) compare(Timestamp.now('UTC'),datetime.now(pytz.timezone('UTC')))