Reduce Array Python Question