File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -190,8 +190,8 @@ def __call__(self, data):
190190 data : an input dataset
191191 """
192192
193- oks = bn .nanmin (data .X , axis = 0 ) != \
194- bn .nanmax (data .X , axis = 0 )
193+ oks = np . logical_and ( ~ bn .allnan (data .X , axis = 0 ),
194+ bn .nanmin ( data . X , axis = 0 ) != bn . nanmax (data .X , axis = 0 ) )
195195 atts = [data .domain .attributes [i ] for i , ok in enumerate (oks ) if ok ]
196196 domain = Orange .data .Domain (atts , data .domain .class_vars ,
197197 data .domain .metas )
Original file line number Diff line number Diff line change @@ -61,10 +61,11 @@ def test_refuse_data_in_constructor(self):
6161
6262class TestRemoveConstant (unittest .TestCase ):
6363 def test_remove_columns (self ):
64- X = np .random .rand (6 , 4 )
64+ X = np .random .rand (6 , 5 )
6565 X [:, (1 ,3 )] = 5
6666 X [3 , 1 ] = np .nan
6767 X [1 , 1 ] = np .nan
68+ X [:, 4 ] = np .nan
6869 data = Table (X )
6970 d = RemoveConstant ()(data )
7071 self .assertEqual (len (d .domain .attributes ), 2 )
You can’t perform that action at this time.
0 commit comments