Skip to content

Fix standardizeMissing indicator handling - #503

Merged
pr0m1th3as merged 2 commits into
gnu-octave:mainfrom
sahilphad07-sudo:fix-standardizeMissing-indicator
Sep 24, 2026
Merged

pr0m1th3as merged 2 commits into
gnu-octave:mainfrom
sahilphad07-sudo:fix-standardizeMissing-indicator

Conversation

@sahilphad07-sudo

@sahilphad07-sudo sahilphad07-sudo commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

standardizeMissing rejected empty and matrix indicators for numeric inputs due to an unnecessary isvector validation check.

This change removes the isvector restriction for numeric indicators, allowing empty and matrix indicators to be handled correctly and matching MATLAB behavior.

Before

octave:> standardizeMissing([1 2 3], [])
error: standardizeMissing: INDICATOR must be a scalar or a vector.

octave:> standardizeMissing([1 2 3; 4 5 6], [1 9; 8 5])
error: standardizeMissing: INDICATOR must be a scalar or a vector.

After

octave:> standardizeMissing([1 2 3], [])
ans =

   1   2   3

octave:> standardizeMissing([1 2 3; 4 5 6], [1 9; 8 5])
ans =

   NaN     2     3
     4   NaN     6

MATLAB Behavior

>> standardizeMissing([1 2 3], [])
ans =

     1     2     3

>> standardizeMissing([1 2 3; 4 5 6], [1 9; 8 5])
ans =

   NaN     2     3
     4   NaN     6

Regression Tests Added

  • Empty indicator
  • Matrix indicator

Test Results

All existing and new standardizeMissing BISTs pass:

PASSES 65 out of 65 tests.

@sahilphad07-sudo sahilphad07-sudo changed the title Fix standardizeMissing indicator handling Use assert_equal in standardizeMissing tests Sep 20, 2026
@sahilphad07-sudo sahilphad07-sudo changed the title Use assert_equal in standardizeMissing tests Fix standardizeMissing indicator handling Sep 20, 2026
@sahilphad07-sudo
sahilphad07-sudo force-pushed the fix-standardizeMissing-indicator branch from 98ec194 to b9ce6e8 Compare September 20, 2026 16:59
@pr0m1th3as
pr0m1th3as merged commit 8793fa2 into gnu-octave:main Sep 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants