This appears to be an issue with the latest version of Numpy. A recent change made it an error to treat a single-element array as a scalar for the purposes of indexing.
stackoverflow上有相关的讨论
https://stackoverflow.com/questions/42128830/typeerror-only-integer-scalar-arrays-can-be-converted-to-a-scalar-index
我的方法是在数组后加上.flatten()
举例:
#原代码
print("The ball picked:", ", ".join(map(lambda x: observations[x], seen)))
#更改后
print("The ball picked:", ", ".join(map(lambda x: observations[x], seen.flatten())))