Position—Wolfram Language Documentation
reference.wolfram.com › language › refPosition returns a list of positions in a form suitable for use in Extract, ReplacePart, and MapAt. The form is different from the one used in Part. Position looks only for matches to values in Association objects that appear in expr. It returns any part specifications within Association objects in the form Key [ k].
list manipulation - How to extract the first and last element ...
mathematica.stackexchange.com › questions › 134323Dec 27, 2016 · It is a elemental question maybe,but I am confusing still.If I have a 1-dimension list list. a = Range[5] (* {1, 2, 3, 4, 5} *) So I can do this to get the first and last element: a[[{1, -1}]] (* {1, 5} *) But when I have a matrix mat,why I cannot do this with same method? mat = Partition[Range[12], 4]; mat[[{{1, 1}, {-1, -1}}]]
Drop—Wolfram Language Documentation
https://reference.wolfram.com/language/ref/Drop.htmlDrop[list, n] gives list with its first n elements dropped. Drop[list, -n] gives list with its last n elements dropped. Drop[list, {n}] gives list with its n\[Null]^th element dropped. Drop[list, {m, n}] gives list with elements m through n dropped. Drop[list, {m, n, s}] gives list with elements m through n in steps of s dropped. Drop[list, seq1, seq2, ...] gives a nested list in which ...