Baunsgaard commented on code in PR #2089:
URL: https://github.com/apache/systemds/pull/2089#discussion_r1741808971


##########
src/main/python/systemds/operator/nodes/matrix.py:
##########
@@ -259,6 +259,23 @@ def var(self, axis: int = None) -> 'OperationNode':
         raise ValueError(
             f"Axis has to be either 0, 1 or None, for column, row or complete 
{self.operation}")
 
+    def unique(self, axis: int = None) -> 'Matrix':
+        """Returns the unique values for the complete matrix, for each row or 
for each column.
+
+        :param axis: can be 0 or 1 to do either row or column uniques
+        :return: `Matrix` representing operation
+        """
+        if axis == 0:
+            named_input_nodes = {"dir": '"c"'}
+            return Matrix(self.sds_context, 'unique', [self], 
named_input_nodes=named_input_nodes)
+        elif axis == 1:
+            named_input_nodes = {"dir": '"r"'}
+            return Matrix(self.sds_context, 'unique', [self], 
named_input_nodes=named_input_nodes)
+        elif axis is None:
+            return Matrix(self.sds_context, 'unique', [self])
+        raise ValueError(

Review Comment:
   error tests.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@systemds.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to