rohdesamuel commented on a change in pull request #15165:
URL: https://github.com/apache/beam/pull/15165#discussion_r671480585



##########
File path: sdks/python/apache_beam/dataframe/frames.py
##########
@@ -3403,10 +3406,16 @@ def value_counts(self, subset=None, sort=False, 
normalize=False,
           "ordering on the dataset which likely will not be preserved.",
           reason="order-sensitive")
     columns = subset or list(self.columns)
-    result = self.groupby(columns).size()
+
+    if dropna:
+      dropped = self.dropna()
+    else:
+      dropped = self
+
+    result = dropped.groupby(columns, dropna=dropna).size()
 
     if normalize:
-      return result/self.dropna().length()
+      return result/dropped.length()

Review comment:
       Yes, the pandas value_counts it defined for both dropna=False and True. 
I added a combinatorial test for dropna and normalize to verify this 
implementation and the pandas implementation.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to