1,where函数会根据指定的条件返回所有满足条件的数组元素的索引值,where返回的是索引值
indices = np.where ( dates==i )
2,take函数可以按照索引值从数组中取出相应的元素
prices = np.take ( close , indices )