Stay organized with collections
Save and categorize content based on your preferences.
Accumulates elements of an array along the given axis, by setting each element of the result to the reduction of elements along that axis up to and including the current position. May be used to make a cumulative sum, a monotonically increasing sequence, etc.
Usage
Returns
Array.accum(axis, reducer)
Array
Argument
Type
Details
this: array
Array
Array to accumulate.
axis
Integer
Axis along which to perform the accumulation.
reducer
Reducer, default: null
Reducer to accumulate values. Default is SUM, to produce the cumulative sum of each vector along the given axis.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-06 UTC."],[[["`Array.accum` calculates the cumulative reduction of elements in an array along a specified axis."],["It uses a reducer function, defaulting to sum, to determine how elements are accumulated."],["The `axis` argument defines the direction of accumulation (0 for rows, 1 for columns in 2D arrays)."],["Various reducers like `min`, `max`, `mean`, and `product` can be used for different cumulative calculations."],["The result is a new array with the same dimensions as the input, containing the accumulated values."]]],[]]