11
11
import pytest
12
12
13
13
from pandas .compat import (
14
- PY3 , PY36 , OrderedDict , is_platform_little_endian , lmap , long , lrange ,
14
+ PY2 , PY3 , PY36 , OrderedDict , is_platform_little_endian , lmap , long , lrange ,
15
15
lzip , range , zip )
16
16
17
17
from pandas .core .dtypes .cast import construct_1d_object_array_from_listlike
20
20
import pandas as pd
21
21
from pandas import (
22
22
Categorical , DataFrame , Index , MultiIndex , Series , Timedelta , Timestamp ,
23
- compat , date_range , isna )
23
+ _np_version_under1p13 , compat , date_range , isna )
24
24
from pandas .tests .frame .common import TestData
25
25
import pandas .util .testing as tm
26
26
@@ -682,6 +682,8 @@ def test_constructor_ndarray(self):
682
682
frame = DataFrame (['foo' , 'bar' ], index = [0 , 1 ], columns = ['A' ])
683
683
assert len (frame ) == 2
684
684
685
+ @pytest .mark .skipif (PY2 and _np_version_under1p13 ,
686
+ reason = "old numpy & py2" )
685
687
def test_constructor_maskedarray (self ):
686
688
self ._check_basic_constructor (ma .masked_all )
687
689
@@ -698,6 +700,8 @@ def test_constructor_maskedarray(self):
698
700
frame = DataFrame (mat , columns = ['A' , 'B' , 'C' ], index = [1 , 2 ])
699
701
assert np .all (~ np .asarray (frame == frame ))
700
702
703
+ @pytest .mark .skipif (PY2 and _np_version_under1p13 ,
704
+ reason = "old numpy & py2" )
701
705
def test_constructor_maskedarray_nonfloat (self ):
702
706
# masked int promoted to float
703
707
mat = ma .masked_all ((2 , 3 ), dtype = int )
@@ -765,6 +769,8 @@ def test_constructor_maskedarray_nonfloat(self):
765
769
assert frame ['A' ][1 ] is True
766
770
assert frame ['C' ][2 ] is False
767
771
772
+ @pytest .mark .skipif (PY2 and _np_version_under1p13 ,
773
+ reason = "old numpy & py2" )
768
774
def test_constructor_maskedarray_hardened (self ):
769
775
# Check numpy masked arrays with hard masks -- from GH24574
770
776
mat_hard = ma .masked_all ((2 , 2 ), dtype = float ).harden_mask ()
@@ -787,6 +793,8 @@ def test_constructor_maskedarray_hardened(self):
787
793
dtype = float )
788
794
tm .assert_frame_equal (result , expected )
789
795
796
+ @pytest .mark .skipif (PY2 and _np_version_under1p13 ,
797
+ reason = "old numpy & py2" )
790
798
def test_constructor_maskedrecarray_dtype (self ):
791
799
# Ensure constructor honors dtype
792
800
data = np .ma .array (
@@ -798,6 +806,8 @@ def test_constructor_maskedrecarray_dtype(self):
798
806
columns = ['date' , 'price' ])
799
807
tm .assert_frame_equal (result , expected )
800
808
809
+ @pytest .mark .skipif (PY2 and _np_version_under1p13 ,
810
+ reason = "old numpy & py2" )
801
811
def test_constructor_mrecarray (self ):
802
812
# Ensure mrecarray produces frame identical to dict of masked arrays
803
813
# from GH3479
0 commit comments