Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have seen discussions of unwanted nulls in the output in the context of building lists with conditions on the elements, but that is not involved here. I would like to know where the nulls come from and how to avoid generating them.


localGroup =

properties = {

lgTable = {#, Table[
       AstronomicalData[#, properties[[n]]]
      {n, 1, Length[properties]}
     } & /@ localGroup;

displayTable[record_] := Module[{},
     #[[1]] <> ": ", #[[2]]
     ] & /@ record[[2]];

(* display two records for illustration *)

displayTable[#] & /@ lgTable[[1 ;; 2]]
share|improve this question

closed as too localized by Oleksandr R., m_goldberg, Yves Klett, Ajasja, acl Feb 18 '13 at 11:18

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 5 down vote accepted

Look at Scan and Map in the documentation, Scan[Print, {1, 2, 3}] returns nothing while Map[Print,{1,2,3}] returns three Null

Just change the last line to:

Scan[displayTable, lgTable[[1 ;; 2]]]
share|improve this answer
A nice bit of magic. Scan has somehow entirely escaped my notice. I am still hoping to find out what generates the nulls. – Gary Palmer Feb 18 '13 at 1:15
@GaryPalmer Print is returning Null try x=Print["hello"] you'll see FullForm[x] is Null. Or simply FullForm@Print@1 – ssch Feb 18 '13 at 1:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.