shunping commented on code in PR #39056:
URL: https://github.com/apache/beam/pull/39056#discussion_r3454651466
##########
sdks/python/apache_beam/dataframe/frames.py:
##########
@@ -5050,11 +5050,19 @@ def get_dummies(self, **kwargs):
cat.split(sep=kwargs.get('sep', '|')) for cat in dtype.categories
]
+ # Find the name pandas uses for the NaN column in get_dummies().
+ # Older pandas versions (<2.3.0) use 'nan', whereas newer versions
+ # use 'NaN'. We dynamically detect it by running a minimal local operation.
+ dummy_nan_col = pd.Series(
+ ['a', None], dtype='category').str.get_dummies().columns.difference(
+ ['a'])[0]
Review Comment:
Fixed.
--
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]