Skip to content

Commit b7ce36a

Browse files
committed
Merge pull request pandas-dev#7264 from jreback/sparc_fixes
DOC/TST: small change to 10min.rst / fixes for (GH7252, GH7263)
2 parents 3574069 + 3c6216c commit b7ce36a

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

doc/source/10min.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,10 @@ Using the :func:`~Series.isin` method for filtering:
291291

292292
.. ipython:: python
293293
294-
df['E']=['one', 'one','two','three','four','three']
295-
df
296-
good_numbers=['two','four']
297-
df[df['E'].isin(good_numbers)]
298-
299-
df.drop('E', inplace=True, axis=1)
294+
df2 = df.copy()
295+
df2['E']=['one', 'one','two','three','four','three']
296+
df2
297+
df2[df2['E'].isin(['two','four'])
300298
301299
Setting
302300
~~~~~~~

pandas/io/stata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def _stata_elapsed_date_to_datetime(date, fmt):
9999
#TODO: IIRC relative delta doesn't play well with np.datetime?
100100
#TODO: When pandas supports more than datetime64[ns], this should be improved to use correct range, e.g. datetime[Y] for yearly
101101
if np.isnan(date):
102-
return np.datetime64('nat')
102+
return NaT
103103

104104
date = int(date)
105105
stata_epoch = datetime.datetime(1960, 1, 1)

pandas/tseries/tests/test_timeseries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2705,7 +2705,7 @@ def test_class_ops(self):
27052705
import pytz
27062706

27072707
def compare(x,y):
2708-
self.assertEqual(int(Timestamp(x).value/1e9), int(Timestamp(y).value/1e9))
2708+
self.assertEqual(int(np.round(Timestamp(x).value/1e9)), int(np.round(Timestamp(y).value/1e9)))
27092709

27102710
compare(Timestamp.now(),datetime.now())
27112711
compare(Timestamp.now('UTC'),datetime.now(pytz.timezone('UTC')))

0 commit comments

Comments
 (0)