I have a question about these two pieces of code
Reap[
For[i = 1, i < 10, i++, Sow[i]; Sow[i^2]; Sow[i!]; Sow[N@Log@i]];
][[2, 1]] ~ Partition ~ 4
and
Reap[
For[i = 1, i < 10, i++, Sow[{i, i^2, i!, N@Log@i}]];
][[2, 1]]
what is the meaning of [ ] [[ ]],I mean what does it do in the code above?
Reapin the documentation and note in what form it gives results. Then look upPart. – gwr Nov 15 '19 at 11:26[[2, 1]] ~Partition~ 4in your first snippet. – J. M.'s missing motivation Nov 15 '19 at 11:27foo[][[i,j]]is the same asdata = foo[]; data[[i,j]];– Nasser Nov 15 '19 at 11:31