Leihua Ye, PhD
Apr 12, 2021

--

Hi Howard,

Thank you so much for running the code and catch the typo. The last line of code "return sequence[i]" had wrong spacing, which is why the code returned only the first value.

The correct spacing should be in parallel to the for loop. I've fixed it, and the code should return the value according to their weights.

p.s. Honestly, there is no better thing when someone actually takes out time, runs the code, and spots a mistake in my writings. Thanks again!

Leihua

--

--

Leihua Ye, PhD

Senior Data Scientist @ Walmart; PhD @ University of California. Data Science | A/B Test & Causal Inference | Career www.linkedin.com/in/leihuaye