Python problem track
Stats the analyst pad asks
NaN-aware means, variance, median, z-score, and a weighted KPI. Spreadsheet instincts, code you can defend.
7 problems · ~62 min total · Data Analyst · BI Analyst · Analytics Engineer · Data Engineer
Step 1 · ~8 min · Tesla, Google
Mean ignoring NaNReturn the arithmetic mean after dropping NaN values, rounded to 2 decimals.
PythonNumPyPyTorchmediumProNot startedStep 2 · ~8 min · Meta, Two Sigma
Population varianceReturn the population variance of x (divide by n, not n-1), rounded to 4 decimal places.
PythonNumPyPyTorchmediumProNot startedStep 3 · ~8 min · Jane Street, Google
Population standard deviationReturn the population standard deviation of x, rounded to 4 decimal places.
PythonNumPyPyTorchmediumProNot startedStep 4 · ~8 min · Amazon, Bloomberg
MedianReturn the median of x. For even length, average the two middle values. Round to 4 decimals.
PythonNumPyPyTorchmediumProNot startedStep 5 · ~8 min · Airbnb, Google
Weighted meanReturn the weighted mean of values with weights, rounded to 4 decimals. Weights are positive and the same length as values.
PythonNumPyPyTorchmediumProNot startedStep 6 · ~12 min · Jane Street, Citadel
Z-scoreStandardize x with population mean and std: (x - mean) / std. Return a list rounded to 4 decimals. If std is 0, return zeros.
PythonNumPyPyTorchhardProNot startedStep 7 · ~10 min · Bloomberg, QuantCo
Moving averageReturn the simple moving average of x with window w (valid / trailing windows only), each value rounded to 4 decimals.
PythonNumPyPyTorchhardProNot started