[ 
https://issues.apache.org/jira/browse/BEAM-12593?focusedWorklogId=623825&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-623825
 ]

ASF GitHub Bot logged work on BEAM-12593:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Jul/21 19:28
            Start Date: 16/Jul/21 19:28
    Worklog Time Spent: 10m 
      Work Description: 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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 623825)
    Time Spent: 2h  (was: 1h 50m)

> DataFrame API: Support pandas 1.3.x
> -----------------------------------
>
>                 Key: BEAM-12593
>                 URL: https://issues.apache.org/jira/browse/BEAM-12593
>             Project: Beam
>          Issue Type: Improvement
>          Components: dsl-dataframe
>            Reporter: Brian Hulette
>            Priority: P2
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> Started a WIP PR here: https://github.com/apache/beam/pull/15008 that used 
> rc1. Now the official 1.3.0 is out.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to