# DeleteMissing issues [duplicate]

Bug introduced in 10.0.0 and fixed in 10.1.0.

Has anyone had problems with the DeleteMissing function in Mathematica 10.0.2? I find that it rarely works. Most of the time it returns a list which still contains all of the missing elements. For example, let's say a = {Missing[], 1, 2, 3} then DeleteMissing[a] returns {Missing[] , 1, 2, 3}.

## marked as duplicate by Szabolcs, Dr. belisarius, Michael E2, Mr.Wizard♦Jan 30 '15 at 0:14

• have not even used it so far, but have you seen und understood the level specification you can give as second argument? Without that it will drop elements at level 1 only, which might (or might not) be your problem... – Albert Retey Jan 29 '15 at 15:09
• Can you provide some code to reproduce the issue? – Yves Klett Jan 29 '15 at 15:13
• @YvesKlett See my edit. – Wintermute Jan 29 '15 at 16:32
• strange, I just tried this with 10.0.2 on Windows 7 and it seems to work (i.e. returns {1,2,3}). What system are you on? – Albert Retey Jan 29 '15 at 16:44
• how exactly do you create such a list, by entering as input or is it returned from other functions? Can you show the offending lists when that happens with InputForm? One possible reason could be something like a "Missing"[] which as output will (with the default settings) look exactly like Missing[] but of course will not be matched by DeleteMissing... – Albert Retey Jan 29 '15 at 18:42

I can reproduce this problem only if the Suggestions Bar is enabled. In this case DeleteMissing seems to mysteriously lose its definition.

In[1]:= {$Version,$VersionNumber, \$ReleaseNumber}
Out[1]= {"10.0 for Mac OS X x86 (64-bit) (December 4, 2014)", 10., 2}

In[2]:= a = {Missing[], 1, 2, 3}
Out[2]= {Missing[], 1, 2, 3}

In[3]:= DeleteMissing[a]
Out[3]= DeleteMissing[{Missing[], 1, 2, 3}]

In[4]:= Definition@DeleteMissing
Out[4]= Definition[DeleteMissing]


This looks to be the exact same issue from here:

Please report it to Wolfram Support.

As a workaround, you can turn off the Suggestions Bar by going to Preferences -> Interface and unchecking Show Suggestions Bar After Last Output. After turning off the Suggestions Bar, it is also necessary to Quit and relaunch the kernel for the problem to go away.

• If you turn off the suggestions bar after you encountered the problem, you will also have to quit and relaunch the kernel. – m_goldberg Jan 29 '15 at 20:38
• @m_goldberg Thank you, updated the answer. – Szabolcs Jan 29 '15 at 20:41
• That and this. I guess I should really be shutting down that bar now. – Sjoerd C. de Vries Jan 29 '15 at 23:47

This is an extension to Szabolcs' answer. I would have explained it in 2nd comment to his answer, but it is a little too complicated to be a comment.

There is another complication in regard to reproducing this problem. It is essential that the assignment

a = {Missing[], 1, 2, 3} ;


be evaluated before a DeleteMissing expression is successfully evaluated and the suggestion bar must up come at its completion.

Starting with a freshly loaded kernel, the suggestions bar enabled, and all the code in one cell.

a = {Missing[], 1, 2, 3} ;
DeleteMissing[a]

{1, 2, 3}


will work.

Quitting from and restarting the kernel and making two separate cells.

a = {Missing[], 1, 2, 3} ; (* evaluate this cell first and separately *)

DeleteMissing[a]

DeleteMissing[{Missing[], 1, 2, 3}]


reproduces the OP's problem exactly.