Skip to content

Commit d83bbff

Browse files
committed
Merge pull request #9942 from jreback/fixes
various windows test / dtype fixes
2 parents 67b08f6 + 48474e0 commit d83bbff

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

pandas/core/generic.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -3341,10 +3341,18 @@ def where(self, cond, other=np.nan, inplace=False, axis=None, level=None,
33413341

33423342
matches = (new_other == np.array(other))
33433343
if matches is False or not matches.all():
3344-
other = np.array(other)
3344+
3345+
# coerce other to a common dtype if we can
3346+
if com.needs_i8_conversion(self.dtype):
3347+
try:
3348+
other = np.array(other, dtype=self.dtype)
3349+
except:
3350+
other = np.array(other)
3351+
else:
3352+
other = np.asarray(other)
3353+
other = np.asarray(other, dtype=np.common_type(other, new_other))
33453354

3346-
# we can't use our existing dtype
3347-
# because of incompatibilities
3355+
# we need to use the new dtype
33483356
try_quick = False
33493357
else:
33503358
other = new_other

pandas/tests/test_frame.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -14231,7 +14231,8 @@ class SubclassedPanel(Panel):
1423114231
self.assertTrue(isinstance(result, SubclassedPanel))
1423214232
expected = SubclassedPanel([[[1, 2, 3]], [[4, 5, 6]]],
1423314233
items=['X', 'Y'], major_axis=[0],
14234-
minor_axis=[0, 1, 2])
14234+
minor_axis=[0, 1, 2],
14235+
dtype='int64')
1423514236
tm.assert_panel_equal(result, expected)
1423614237

1423714238

pandas/tests/test_util.py

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import nose
55

6+
import sys
67
import pandas.util
78
from pandas.util.decorators import deprecate_kwarg
89
import pandas.util.testing as tm
@@ -80,6 +81,9 @@ def test_warning(self):
8081
self.assertNotAlmostEquals(1, 2)
8182

8283
def test_locale(self):
84+
if sys.platform == 'win32':
85+
raise nose.SkipTest("skipping on win platforms as locale not available")
86+
8387
#GH9744
8488
locales = pandas.util.testing.get_locales()
8589
self.assertTrue(len(locales) >= 1)

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ def pxd(name):
602602
],
603603
package_data={'pandas.io': ['tests/data/legacy_hdf/*.h5',
604604
'tests/data/legacy_pickle/*/*.pickle',
605-
'tests/data/*.csv',
605+
'tests/data/*.csv*',
606606
'tests/data/*.dta',
607607
'tests/data/*.txt',
608608
'tests/data/*.xls',

0 commit comments

Comments
 (0)