How to grab a column of a list?

I need to grab the first column of a list, and it's just really confusing. I've tried using hyperblocks, because I'm pretty sure it worked before, but I can't get it to work. Please help me figure it out (and maybe add an easy way to get a column of a list to the item () of block).

edit: if anyone comes across this with the same question, I just found this in the manual

I think there's such a block in one of the official libraries, but I don't remember which library it is.

no, also, did you see my edit.

Yeah, you have found it in the manual. Isn't in some library a block that extracts multiple columns from a 'database'?

I don't think so.

untitled script pic - 2021-11-17T204540.288

Oh, are you saying, dardoro, that it is in fact an option hidden in the __ of__ block?

I'm now realizing that that does work. I don't know why I didn't think of that, but I also want to use hyperblocks, because when dealing with large lists, they are faster.

:wink:
OF

Thanks. I would not expect it to find it there, maybe because there is another __ of__ block in the blue category, and I must have thought there's only one such block.

I think you'll find


reasonably fast (where 3 is the column number, and of course you can put a list in that input to specify more than one column. That's more straightforward than the example in the manual that uses an empty list as the first input to ITEM.

I might use that instead.

And if you want a new list with 2 colums(1 and 3), map a list with item1 and item3

Take a look on my list tutorial: map section
https://snap.berkeley.edu/snap/snap.html#present:Username=loucheman&ProjectName=List%20Tutorial&editMode&noRun

Wow, loucheman, I love the list tutorial that you made. Thank you for sharing it here.

That's a nice tutorial. I have a quibble about language: You say (LIST 1 2 3) makes a list with three rows, but "rows" really makes sense only for lists of lists. It's equally plausible to say that that's a list of one row with three items! I would just not use "row" at all in talking about one-dimensional list; use "item" instead.

Of course I wish you started with the functional blocks instead of starting with the imperative ones... And I would include an explanation about how HOFs use an empty input slot to represent each item.

I thought of
untitled script pic (27)
when I saw this thread. And then I saw the post about columns.

Is there any difference?

I found transpose with the search facility but I noticed it is not on the menu of of.

I usually use Brian's map solution but if one is going to need most or all of the columns I assume transpose is faster.

Help is still missing for of (and much else).

they\re waiting for a new help system before they update the help screens.

Not in 7dev; I renamed "reportListLength.png" to "reportListAttribute" in a pull request, and Jens merged it.

COLUMNS is fast and simple, and restricted to 2D arrays. TRANSPOSE does the full APL transpose that works for any number of dimensions, so that the shape of the result is the reverse of the shape of the input.

joecooldoo has contributed a few help screens that I hope Jens will pull for v7.