本文整理汇总了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)
示例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)
示例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)
示例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)