繁体   English   中英

H2O python rbind错误

[英]H2O python rbind error

我有一个2000行数据帧,我试图将相同的数据帧切成两个并将它们组合在一起。

t1 = test[:10, :]
t2 = test[20:, :]
temp = t1.rbind(t2)
temp.show()

然后我收到了这个错误:

---------------------------------------------------------------------------
EnvironmentError                          Traceback (most recent call last)
<ipython-input-37-8daeb3375743> in <module>()
      2 t2 = test[20:, :]
      3 temp = t1.rbind(t2)
----> 4 temp.show()
      5 print len(temp)
      6 print len(test)

/usr/local/lib/python2.7/dist-packages/h2o/frame.pyc in show(self, use_pandas)
    383       print("This H2OFrame has been removed.")
    384       return
--> 385     if not self._ex._cache.is_valid(): self._frame()._ex._cache.fill()
    386     if H2ODisplay._in_ipy():
    387       import IPython.display

/usr/local/lib/python2.7/dist-packages/h2o/frame.pyc in _frame(self, fill_cache)
    423 
    424   def _frame(self, fill_cache=False):
--> 425     self._ex._eager_frame()
    426     if fill_cache:
    427       self._ex._cache.fill()

/usr/local/lib/python2.7/dist-packages/h2o/expr.pyc in _eager_frame(self)
     67     if not self._cache.is_empty(): return self
     68     if self._cache._id is not None: return self  # Data already computed under ID, but not cached locally
---> 69     return self._eval_driver(True)
     70 
     71   def _eager_scalar(self):  # returns a scalar (or a list of scalars)

/usr/local/lib/python2.7/dist-packages/h2o/expr.pyc in _eval_driver(self, top)
     81   def _eval_driver(self, top):
     82     exec_str = self._do_it(top)
---> 83     res = ExprNode.rapids(exec_str)
     84     if 'scalar' in res:
     85       if isinstance(res['scalar'], list): self._cache._data = [float(x) for x in res['scalar']]

/usr/local/lib/python2.7/dist-packages/h2o/expr.pyc in rapids(expr)
    163       The JSON response (as a python dictionary) of the Rapids execution
    164     """
--> 165     return H2OConnection.post_json("Rapids", ast=expr,session_id=H2OConnection.session_id(), _rest_version=99)
    166 
    167 class ASTId:

/usr/local/lib/python2.7/dist-packages/h2o/connection.pyc in post_json(url_suffix, file_upload_info, **kwargs)
    515     if __H2OCONN__ is None:
    516       raise ValueError("No h2o connection. Did you run `h2o.init()` ?")
--> 517     return __H2OCONN__._rest_json(url_suffix, "POST", file_upload_info, **kwargs)
    518 
    519   def _rest_json(self, url_suffix, method, file_upload_info, **kwargs):

/usr/local/lib/python2.7/dist-packages/h2o/connection.pyc in _rest_json(self, url_suffix, method, file_upload_info, **kwargs)
    518 
    519   def _rest_json(self, url_suffix, method, file_upload_info, **kwargs):
--> 520     raw_txt = self._do_raw_rest(url_suffix, method, file_upload_info, **kwargs)
    521     return self._process_tables(raw_txt.json())
    522 

/usr/local/lib/python2.7/dist-packages/h2o/connection.pyc in _do_raw_rest(self, url_suffix, method, file_upload_info, **kwargs)
    592       raise EnvironmentError(("h2o-py got an unexpected HTTP status code:\n {} {} (method = {}; url = {}). \n"+ \
    593                               "detailed error messages: {}")
--> 594                               .format(http_result.status_code,http_result.reason,method,url,detailed_error_msgs))
    595 
    596 

EnvironmentError: h2o-py got an unexpected HTTP status code:
500 Server Error (method = POST; url = http://localhost:54321/99/Rapids). 
detailed error messages: []

如果我计算行数(len(temp)),它就可以找到。 此外,如果我稍微更改切片索引,它也可以找到。 例如,如果我更改为此,则显示数据框。

t1 = test[:10, :]
t2 = test[:5,  :]

我在这里想念一下吗? 谢谢。

不清楚发生了什么没有更多的信息(日志可能会说为什么rbind没有采取)。

你用的是什么版本? 我在最前沿尝试了使用虹膜的代码,这一切都按预期工作。

顺便说一句,rbind通常会很昂贵,特别是因为你在语义上的后续是一个子集:

test[range(10) + range(20,test.nrow),:]

还应该给你想要的子集(告诫你在python中创建行索引的完整列表,并通过REST传递给h2o)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM