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


##########
src/main/python/systemds/operator/nodes/matrix.py:
##########
@@ -244,6 +244,22 @@ def min(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 countDistinct(self, axis: int = None) -> 'OperationNode':
+        """Calculate the number of distinct values of matrix.
+
+        :param axis: can be 0 or 1 to do either row or column aggregation
+        :return: `Matrix` representing operation
+        """
+        if axis == 0:
+            return Matrix(self.sds_context, 'colCountDistinct', [self])
+        elif axis == 1:
+            return Matrix(self.sds_context, 'rowCountDistinct', [self])
+        elif axis is None:
+            return Scalar(self.sds_context, 'countDistinct', [self])
+        raise ValueError(
+            f"Axis has to be either 0, 1 or None, for column, row or complete 
{self.operation}")

Review Comment:
   then we need to add it for them as well, 
   unfortunately we do not see these things because we do not have code 
coverage for the Python API,
   It would be cool to have that as well.



-- 
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