We deliver solutions for the AI eraâcombining symbolic computation, data-driven insights and deep technology expertise.
BlockMap[f,list,n]
applies f to non-overlapping sublists of length n in list.
BlockMap[f,list,n,d]
applies f to sublists with offset d in list.
BlockMap[f,list,{n1,n2,…},…]
applies f to blocks of size n1×n2×….
DetailsApply a function to all non-overlapping, length-2 sublists:
Apply a function to overlapping sublists of length 2 with offset 1:
Apply a function to all 2x2 sub-matrices:
Scope (8)Apply a function to a ragged array:
Apply a function to blocks of size {2,1,2} of a rank-3 array:
Specify an offset {1,2} with a block size {2,2} to allow overlapping for rows but not for columns:
Multidimensional offsets are effectively coerced to match the block size specification:
Skip elements by using an offset larger than the block size:
Incomplete sublists at the end are dropped:
The head need not be List:
BlockMap works with SparseArray objects:
Applications (5)Compute successive differences of elements:
Compute a moving average with runs of 3 elements:
Compute a moving median of a matrix:
Compute a moving quantile for some data:
Smooth a simulated particle trajectory:
The underlying signal and simulated path with noise:
Smooth the trajectory using a moving TrimmedMean:
Increasing the window size gives a smoother trajectory:
Properties & Relations (2)BlockMap is effectively the same as using Map and Partition:
BlockMap need not construct all the sublists and requires less memory:
ListCorrelate[ker,list] effectively combines ker with a sliding block in list:
Use an offset of 1 in BlockMap to apply the function to overlapping segments the length of ker:
ListConvolve is similar except the kernel is reversed:
Wolfram Research (2015), BlockMap, Wolfram Language function, https://reference.wolfram.com/language/ref/BlockMap.html. TextWolfram Research (2015), BlockMap, Wolfram Language function, https://reference.wolfram.com/language/ref/BlockMap.html.
CMSWolfram Language. 2015. "BlockMap." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/BlockMap.html.
APAWolfram Language. (2015). BlockMap. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BlockMap.html
BibTeX@misc{reference.wolfram_2025_blockmap, author="Wolfram Research", title="{BlockMap}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/BlockMap.html}", note=[Accessed: 12-July-2025 ]}
BibLaTeX@online{reference.wolfram_2025_blockmap, organization={Wolfram Research}, title={BlockMap}, year={2015}, url={https://reference.wolfram.com/language/ref/BlockMap.html}, note=[Accessed: 12-July-2025 ]}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4