【发布时间】:2016-04-17 05:23:01
【问题描述】:
我试图在图形实验室创建一个非常简单的 .apply 应用程序,但我对它为什么不起作用感到困惑。
def myfunc (x):
if(x == 0):
x = -1
sa = SArray([0,0,0,1,1], dtype=int)
sa.apply(myfunc, dtype = int)
我的输出是
[None, None, None, None, None]
为什么不是 [-1, -1, -1, 1, 1],我该如何解决?
【问题讨论】:
标签: python-2.7 graphlab