Previous question · 1386
Fix Broken Sequential Test
hardPair Programming
Next question · 1388
Difference In Differences Estimator
mediumStatistics
Random coding question

1387. Cumulative sum features

easy
GeneralGeneral
senior
Function contract
Inputs
groups
np.ndarray
values
np.ndarray
Returns
value
np.ndarray

Examples

Input
{
  "groups": [
    "A",
    "A",
    "B",
    "A",
    "B"
  ],
  "values": [
    10,
    5,
    2,
    7,
    1
  ]
}
Output
[
  10,
  15,
  2,
  22,
  3
]

Constraints

Hint 1
Hint 2
Hint 3
Roles
ML Engineer
AI Engineer
Data Scientist
Research Scientist
Analytics Engineer
Companies
GeneralGeneral
Levels
senior
entry
Tags
prefix-sum
hashmap
feature-engineering
time-series

Similar Questions

Linear Regressionmedium
ML Coding
Activation function relueasy
ML Coding
Text normalizationmedium
ML Coding
20 people are solving this problem
Loading editor for the selected language
Ln 1, Col 1
Program Output
DATAINTERVIEW
Interactive coding terminal
Python / NumPy environment ready.
Type a command below or run code from the editor.
run scriptExecute the current editor contents
submitGrade the current editor contents against all solution test cases
python ("print hello world")Run an isolated Python command
helpShow all available commands