0

How can I subset a h2o frame in python based on a list, rather than a single value? For example, in R one would use %in%, or in panda I can see one can use .isin(). I'd like to do something like this, if it makes sense:

df.loc[df['column name'].isin(pickTheseValues)]

How does it work in h2o? Alternatively, can I cast the h2o data frame into panda and do the operation as above?

Nonancourt
  • 559
  • 2
  • 10
  • 21

1 Answers1

1

h2o provides slicing rows on dataframe for both R and Python so you can use isin method to filter rows based on a column.

mask = df["column name"].isin(pickTheseValues)
cols = df[mask,:]

You can reach the details by this link.

dogankadriye
  • 538
  • 3
  • 13