Wolfram: Flatten
Flatten
Flatten-
Flatten[ list]Flatten[ list, n]Flatten[ list, n, h ]
flatten a list, up to level n (default
Infinity), and only those with Head h (defaultList)Flatten[ {3, {9, {4}}, 5} ] (* {3, 9, 4, 5} *) Flatten[ {3, {9, {4}}, 5}, 1 ] (* {3, 9, {4}, 5} *) Flatten[ {3, {9, {4}}, 5}, 2 ] (* {3, 9, 4, 5} *) (* flatten only those with head f *) Flatten[ {3, f[9, {4}], g[5]}, Infinity, f ] (* {3, 9, {4}, g[5]} *)
Wolfram. List Operations, and Loop, Iteration, Recursion
- Wolfram: List Operations
- Wolfram: List. Create (Table)
- Wolfram: Create Flat List (Range)
- Wolfram: List. Get Parts
- Wolfram: List. Add Element
- Wolfram: List. Delete Element
- Wolfram: List. Change Element
- Wolfram: List. Check Exist
- Wolfram: List. Join, Union, Intersection, Difference
- Wolfram: List. Min, Max
- Wolfram: List. Filter
- Wolfram: List. Sort Reverse Ordering
- Wolfram: Flatten
- Wolfram: Riffle (Add at Every Nth)
- Wolfram: RotateLeft
- Wolfram: Padding
- Wolfram: List. Partition, Reshape, Split, Gather
- Wolfram: Transpose
- Wolfram: List. Same Items Counts, Tally, Group
- Wolfram: List. Combinatorics
- Wolfram: Iteration
- Wolfram: Map Function to List
- Wolfram: Scan (foreach)
- Wolfram: Recursion
- Wolfram: Fold (reduce)
- Wolfram: Loop