H2OFrameをスライスするには、行単位でさまざまな方法があります。これらの方法については、H2OユーザーガイドのセクションSlicing Rowsに概要が記載されています。ここ
はアイリスデータセットを使用して特定の値に設定されている列に基づいてH2OFrameをサブセット化のPythonの例である:
import h2o
h2o.init()
# Load data
path = "http://h2o-public-test-data.s3.amazonaws.com/smalldata/iris/iris_wheader.csv"
df = h2o.import_file(path=path)
# Subset data
mask = df["class"] == "Iris-setosa"
newdf = df[mask, :]
# equivalent to both of these, which also work
# newdf = df[df["class"] == "Iris-setosa", :]
# newdf = df[df["class"] == "Iris-setosa"]
newdf = df[df["class"] == "Iris-setosa"]
バージョンはH2OFrames除いて、上記の持っている形式とほぼ同じです次のような列の参照をサポートしていません。df.class
;あなたは:df["class"]
を使用する必要があります。