Skip to content

Win32 fix2 #5574

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
Nov 22, 2013
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
4 changes: 2 additions & 2 deletions pandas/io/tests/test_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def test_int_types(self):
frame.to_excel(path, 'test1')
reader = ExcelFile(path)
recons = reader.parse('test1')
int_frame = frame.astype(int)
int_frame = frame.astype(np.int64)
tm.assert_frame_equal(int_frame, recons)
recons2 = read_excel(path, 'test1')
tm.assert_frame_equal(int_frame, recons2)
Expand Down Expand Up @@ -616,7 +616,7 @@ def test_roundtrip_indexlabels(self):
has_index_names=self.merge_cells
).astype(np.int64)
frame.index.names = ['test']
self.assertAlmostEqual(frame.index.names, recons.index.names)
tm.assert_frame_equal(frame,recons.astype(bool))

with ensure_clean(self.ext) as path:

Expand Down
7 changes: 7 additions & 0 deletions pandas/io/tests/test_packers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import datetime
import numpy as np
import sys
from distutils.version import LooseVersion

from pandas import compat
from pandas.compat import u
Expand Down Expand Up @@ -197,6 +199,11 @@ def test_timestamp(self):

def test_datetimes(self):

# fails under 2.6/win32 (np.datetime64 seems broken)

if LooseVersion(sys.version) < '2.7':
raise nose.SkipTest('2.6 with np.datetime64 is broken')

for i in [datetime.datetime(
2013, 1, 1), datetime.datetime(2013, 1, 1, 5, 1),
datetime.date(2013, 1, 1), np.datetime64(datetime.datetime(2013, 1, 5, 2, 15))]:
Expand Down
2 changes: 1 addition & 1 deletion pandas/sparse/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _sparse_array_op(left, right, op, name):

try:
fill_value = op(left.fill_value, right.fill_value)
except ZeroDivisionError:
except:
fill_value = nan

return SparseArray(result, sparse_index=result_index,
Expand Down
13 changes: 9 additions & 4 deletions pandas/sparse/tests/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,15 @@ def _check_op(op, first, second):

res4 = op(first, 4)
tm.assert_isinstance(res4, SparseArray)
exp = op(first.values, 4)
exp_fv = op(first.fill_value, 4)
assert_almost_equal(res4.fill_value, exp_fv)
assert_almost_equal(res4.values, exp)

# ignore this if the actual op raises (e.g. pow)
try:
exp = op(first.values, 4)
exp_fv = op(first.fill_value, 4)
assert_almost_equal(res4.fill_value, exp_fv)
assert_almost_equal(res4.values, exp)
except (ValueError) :
pass

def _check_inplace_op(op):
tmp = arr1.copy()
Expand Down
2 changes: 1 addition & 1 deletion pandas/tools/tests/test_tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test_na_handling(self):

def test_inf_handling(self):
data = np.arange(6)
data_ser = Series(data)
data_ser = Series(data,dtype='int64')

result = cut(data, [-np.inf, 2, 4, np.inf])
result_ser = cut(data_ser, [-np.inf, 2, 4, np.inf])
Expand Down
4 changes: 3 additions & 1 deletion pandas/tools/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ def _format_levels(bins, prec, right=True,

def _format_label(x, precision=3):
fmt_str = '%%.%dg' % precision
if com.is_float(x):
if np.isinf(x):
return str(x)
elif com.is_float(x):
frac, whole = np.modf(x)
sgn = '-' if x < 0 else ''
whole = abs(whole)
Expand Down