Skip to content

Commit

Permalink
add unique to python
Browse files Browse the repository at this point in the history
  • Loading branch information
spennihana committed Jul 17, 2015
1 parent 713b27f commit 90423fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 9 additions & 1 deletion h2o-py/h2o/frame.py
Expand Up @@ -271,7 +271,7 @@ def filterNACols(self, frac=0.2):
:param frac: Fraction of NAs in the column.
:return: A list of column indices.
"""
return H2OFrame(ExprNode("filterNACols"), self, frac)._frame()
return H2OFrame(expr=ExprNode("filterNACols", self, frac))._frame()

def dim(self):
"""
Expand All @@ -281,6 +281,14 @@ def dim(self):
"""
return [self.nrow(), self.ncol()]

def unique(self):
"""
Extract the unique values in the column.
:return: A new H2OFrame of just the unique values in the column.
"""
return H2OFrame(expr=ExprNode("unique", self))._frame()

def show(self): self.head(10,sys.maxint) # all columns

def head(self, rows=10, cols=200, **kwargs):
Expand Down
3 changes: 0 additions & 3 deletions h2o-py/h2o/h2o.py
Expand Up @@ -187,9 +187,6 @@ def get_model(model_id):
else: raise NotImplementedError(model_type)


def str(frame):
pass

def get_frame(frame_id):
"""
Obtain a handle to the frame in H2O with the frame_id key.
Expand Down

0 comments on commit 90423fa

Please sign in to comment.