当前位置: 首页>>代码示例>>Python>>正文


Python H2OFrame.send_frame方法代码示例

本文整理汇总了Python中frame.H2OFrame.send_frame方法的典型用法代码示例。如果您正苦于以下问题:Python H2OFrame.send_frame方法的具体用法?Python H2OFrame.send_frame怎么用?Python H2OFrame.send_frame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在frame.H2OFrame的用法示例。


在下文中一共展示了H2OFrame.send_frame方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: export_file

# 需要导入模块: from frame import H2OFrame [as 别名]
# 或者: from frame.H2OFrame import send_frame [as 别名]
def export_file(frame,path,force=False):
  """
  Export a given H2OFrame to a path on the machine this python session is currently connected to. To view the current session, call h2o.cluster_info().

  :param frame: The Frame to save to disk.
  :param path: The path to the save point on disk.
  :param force: Overwrite any preexisting file with the same path
  :return: None
  """
  fr = H2OFrame.send_frame(frame)
  f = "true" if force else "false"
  H2OConnection.get_json("Frames/"+str(fr)+"/export/"+path+"/overwrite/"+f)
开发者ID:yuecong,项目名称:h2o-3,代码行数:14,代码来源:h2o.py

示例2: as_list

# 需要导入模块: from frame import H2OFrame [as 别名]
# 或者: from frame.H2OFrame import send_frame [as 别名]
def as_list(data, use_pandas=True):
  """
  Convert an H2O data object into a python-specific object.

  WARNING: This will pull all data local!

  If Pandas is available (and use_pandas is True), then pandas will be used to parse the data frame.
  Otherwise, a list-of-lists populated by character data will be returned (so the types of data will
  all be str).

  :param data: An H2O data object.
  :param use_pandas: Try to use pandas for reading in the data.
  :return: List of list (Rows x Columns).
  """

  # check to see if we can use pandas
  found_pandas=False
  try:
    imp.find_module('pandas')  # if have pandas, use this to eat a frame
    found_pandas = True
  except ImportError:
    found_pandas = False

  # if frame, download the frame and jam into lol or pandas df
  if isinstance(data, H2OFrame):
    fr = H2OFrame.send_frame(data)
    res = _as_data_frame(fr, use_pandas and found_pandas)
    removeFrameShallow(fr)
    return res

  if isinstance(data, Expr):
    if data.is_local(): return data._data
    if data.is_pending():
      data.eager()
      if data.is_local(): return [data._data] if isinstance(data._data, list) else [[data._data]]
    return _as_data_frame(data._data, use_pandas and found_pandas)

  if isinstance(data, H2OVec):
    if data._expr.is_local(): return data._expr._data
    if data._expr.is_pending():
      data._expr.eager()
      if data._expr.is_local(): return [[data._expr._data]]

    return as_list(H2OFrame(vecs=[data]), use_pandas)
开发者ID:yuecong,项目名称:h2o-3,代码行数:46,代码来源:h2o.py

示例3: remove

# 需要导入模块: from frame import H2OFrame [as 别名]
# 或者: from frame.H2OFrame import send_frame [as 别名]
def remove(object):
  """
  Remove object from H2O. This is a "hard" delete of the object. It removes all subparts.

  :param object: The object pointing to the object to be removed.
  :return: None
  """
  if object is None:
    raise ValueError("remove with no object is not supported, for your protection")

  if isinstance(object, H2OFrame):
    fr = H2OFrame.send_frame(object)
    remove(fr)
    object._vecs=[]

  elif isinstance(object, H2OVec):
    H2OConnection.delete("DKV/"+str(object.key()))
    object._expr=None
    object=None

  else:
    H2OConnection.delete("DKV/" + object)
开发者ID:yuecong,项目名称:h2o-3,代码行数:24,代码来源:h2o.py

示例4: export_file

# 需要导入模块: from frame import H2OFrame [as 别名]
# 或者: from frame.H2OFrame import send_frame [as 别名]
def export_file(frame,path,force=False):
  fr = H2OFrame.send_frame(frame)
  f = "true" if force else "false"
  H2OConnection.get_json("Frames/"+str(fr)+"/export/"+path+"/overwrite/"+f)
开发者ID:darraghdog,项目名称:h2o-dev,代码行数:6,代码来源:h2o.py


注:本文中的frame.H2OFrame.send_frame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。