def from_pandas(X):
"""A simple wrapper for H2OFrame.from_python. This takes
a pandas dataframe and returns an H2OFrame with all the
default args (generally enough) plus named columns.
Parameters
----------
X : pd.DataFrame
The dataframe to convert.
Returns
-------
H2OFrame
"""
pd, _ = validate_is_pd(X, None)
# older version of h2o are super funky with this
if parse_version(h2o.__version__) < parse_version('3.10.0.7'):
h = 1
else:
h = 0
# if h2o hasn't started, we'll let this fail through
return H2OFrame.from_python(X, header=h, column_names=X.columns.tolist())
评论列表
文章目录