2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-15 06:12:59 +00:00
cheat.sheets/sheets/_mathematica/levelspec
terminalforlife d7473ac185 Fix trailing whitespace on all files
Tidy files; tidy soul!
2020-02-22 02:47:54 +00:00

22 lines
510 B
Plaintext

(* Standard levelspec for things like Map, Apply, Position, etc *)
(* n - levels 1 through n *)
Map[f,l,3]
(* Infinity - levels 1 through infinity *)
Map[f,l,Infinity]
(* {n} - level n only *)
Map[f,l,{3}]
(* {n1,n2} - levels n1 through n2 *)
Map[f,l,{2,5}]
(* The default levelspec is {1} *)
Map[f,l]===Map[f,l,{1}]
(*
A positive level n consists of all parts of expr specified by n indices.
A negative level -n consists of all parts of expr with depth n.
Level 0 corresponds to the whole expression.
*)