python 3.6 list(map())问题
伊谢尔伦
伊谢尔伦 2017-04-18 10:19:00
0
2
883
map(lambda x: [ret_ttest.loc[x][0], ret_ttest.loc[x][1]], ret_ttest.index)

结果:

list(map(lambda x: [ret_ttest.loc[x][0], ret_ttest.loc[x][1]], ret_ttest.index))

报错:---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in ()
----> 1 ret_ttest_df = list(map(lambda x: ret_ttest.loc[x, ret_ttest.locx], ret_ttest.index))

TypeError: 'list' object is not callable

前几天升级了3.6,现在map对象不是在外面添加list()来转换吗

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all (2)
伊谢尔伦

Use a for loop to iterate.
Like this

    小葫芦

    This map is lazy evaluation and returns something similar to an iterator. Looking at the error message, it should be a problem with your lambda expression. The previous one did not report an error because it was not executed. So check whether the lambda expression you passed in is Not a problem.

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!