Skip to content

COMPAT: dtype fix for windows tests; ensure passing i8 to tslib/normalize #9642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/tseries/tests/test_resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ def test_resmaple_dst_anchor(self):

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

assert_frame_equal(df.resample("W-MON", how=how)[["a", "b", "c"]],
Expand Down
5 changes: 3 additions & 2 deletions pandas/tslib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ class Timestamp(_Timestamp):
tz = maybe_get_tz(tz)
if not isinstance(ambiguous, basestring):
ambiguous = [ambiguous]
value = tz_localize_to_utc(np.array([self.value]), tz,
value = tz_localize_to_utc(np.array([self.value],dtype='i8'), tz,
ambiguous=ambiguous)[0]
return Timestamp(value, tz=tz)
else:
Expand All @@ -468,6 +468,7 @@ class Timestamp(_Timestamp):
raise TypeError('Cannot localize tz-aware Timestamp, use '
'tz_convert for conversions')


def tz_convert(self, tz):
"""
Convert Timestamp to another time zone or localize to requested time
Expand Down Expand Up @@ -569,7 +570,7 @@ class Timestamp(_Timestamp):
Normalize Timestamp to midnight, preserving
tz information.
"""
normalized_value = date_normalize(np.array([self.value]), tz=self.tz)[0]
normalized_value = date_normalize(np.array([self.value], dtype='i8'), tz=self.tz)[0]
return Timestamp(normalized_value).tz_localize(self.tz)

def __radd__(self, other):
Expand Down