J'ai des problèmes avec la fonction apply de H2O dans Python 3.6.1 sous anaconda 4.3.22. Je suis exécutant la version H2O 3.10.4.4 sur Windows 10. Je soupçonne que cela peut être un bugH2O.apply La fonction python semble être cassée
J'ai pris cet exemple extrait de livret H2O, page 14 (ou bien il y a un bug dans la documentation.): http://docs.h2o.ai/h2o/latest-stable/h2o-docs/booklets/PythonBooklet.pdf
df5 = h2o.H2OFrame.from_python(np.random.randn(100,4).tolist(), column_names=list("ABCD"))
df5.apply(lambda x: x.mean(na_rm=True))
Et je suis l'erreur:
IndexError Traceback (most recent call last)
<ipython-input-138-e45989298b6f> in <module>()
1 df5 = h2o.H2OFrame.from_python(np.random.randn(100,4).tolist(), column_names=
2 list("ABCD"))
----> 3 df5.apply(lambda x: x.mean(na_rm=True))
C:\cygwin64\usr\local\anaconda3\lib\site-packages\h2o\frame.py in apply(self, fun, axis)
2756 assert_is_type(fun, FunctionType)
2757 assert_satisfies(fun, fun.__name__ == "<lambda>")
-> 2758 res = _bytecode_decompile_lambda(fun.__code__)
2759 return H2OFrame._expr(expr=ExprNode("apply", self, 1 + (axis == 0), *res))
2760
C:\cygwin64\usr\local\anaconda3\lib\site-packages\h2o\astfun.py in _bytecode_decompile_lambda(co)
86 raise ValueError("unimpl: op in hasjrel")
87 elif op in haslocal:
---> 88 args.append(co.co_varnames[oparg]) # LOAD_FAST
89 elif op in hascompare:
90 args.append(cmp_op[oparg]) # COMPARE_OP
IndexError: tuple index out of range
"anaconda3" implique Python 3? (Il pourrait être utile de donner la version exacte de Python.) Je me demande si ce code est seulement pour Python 2.7? –
J'ai mis à jour les informations de version. Je doute que ce soit un problème Python 2.7 vs. 3.x à cause de l'erreur "tuple index out of range", mais c'est possible. –