Skip to content

Commit bc2340d

Browse files
committed
Merge pull request #9642 from jreback/winfix2
COMPAT: dtype fix for windows tests; ensure passing i8 to tslib/normalize
2 parents cce1ccb + fbbf879 commit bc2340d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pandas/tseries/tests/test_resample.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ def test_resmaple_dst_anchor(self):
884884

885885
dti = date_range('2013-09-30', '2013-11-02', freq='30Min', tz='Europe/Paris')
886886
values = range(dti.size)
887-
df = DataFrame({"a": values, "b": values, "c": values}, index=dti)
887+
df = DataFrame({"a": values, "b": values, "c": values}, index=dti, dtype='int64')
888888
how = {"a": "min", "b": "max", "c": "count"}
889889

890890
assert_frame_equal(df.resample("W-MON", how=how)[["a", "b", "c"]],

pandas/tslib.pyx

+3-2
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ class Timestamp(_Timestamp):
456456
tz = maybe_get_tz(tz)
457457
if not isinstance(ambiguous, basestring):
458458
ambiguous = [ambiguous]
459-
value = tz_localize_to_utc(np.array([self.value]), tz,
459+
value = tz_localize_to_utc(np.array([self.value],dtype='i8'), tz,
460460
ambiguous=ambiguous)[0]
461461
return Timestamp(value, tz=tz)
462462
else:
@@ -468,6 +468,7 @@ class Timestamp(_Timestamp):
468468
raise TypeError('Cannot localize tz-aware Timestamp, use '
469469
'tz_convert for conversions')
470470

471+
471472
def tz_convert(self, tz):
472473
"""
473474
Convert Timestamp to another time zone or localize to requested time
@@ -569,7 +570,7 @@ class Timestamp(_Timestamp):
569570
Normalize Timestamp to midnight, preserving
570571
tz information.
571572
"""
572-
normalized_value = date_normalize(np.array([self.value]), tz=self.tz)[0]
573+
normalized_value = date_normalize(np.array([self.value], dtype='i8'), tz=self.tz)[0]
573574
return Timestamp(normalized_value).tz_localize(self.tz)
574575

575576
def __radd__(self, other):

0 commit comments

Comments
 (0)