Skip to content

various windows test / dtype fixes #9942

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 4 commits into from
Apr 20, 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
14 changes: 11 additions & 3 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3341,10 +3341,18 @@ def where(self, cond, other=np.nan, inplace=False, axis=None, level=None,

matches = (new_other == np.array(other))
if matches is False or not matches.all():
other = np.array(other)

# coerce other to a common dtype if we can
if com.needs_i8_conversion(self.dtype):
try:
other = np.array(other, dtype=self.dtype)
except:
other = np.array(other)
else:
other = np.asarray(other)
other = np.asarray(other, dtype=np.common_type(other, new_other))

# we can't use our existing dtype
# because of incompatibilities
# we need to use the new dtype
try_quick = False
else:
other = new_other
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -14231,7 +14231,8 @@ class SubclassedPanel(Panel):
self.assertTrue(isinstance(result, SubclassedPanel))
expected = SubclassedPanel([[[1, 2, 3]], [[4, 5, 6]]],
items=['X', 'Y'], major_axis=[0],
minor_axis=[0, 1, 2])
minor_axis=[0, 1, 2],
dtype='int64')
tm.assert_panel_equal(result, expected)


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

import nose

import sys
import pandas.util
from pandas.util.decorators import deprecate_kwarg
import pandas.util.testing as tm
Expand Down Expand Up @@ -80,6 +81,9 @@ def test_warning(self):
self.assertNotAlmostEquals(1, 2)

def test_locale(self):
if sys.platform == 'win32':
raise nose.SkipTest("skipping on win platforms as locale not available")

#GH9744
locales = pandas.util.testing.get_locales()
self.assertTrue(len(locales) >= 1)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ def pxd(name):
],
package_data={'pandas.io': ['tests/data/legacy_hdf/*.h5',
'tests/data/legacy_pickle/*/*.pickle',
'tests/data/*.csv',
'tests/data/*.csv*',
'tests/data/*.dta',
'tests/data/*.txt',
'tests/data/*.xls',
Expand Down