You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "tvalentyn (via GitHub)" <gi...@apache.org> on 2024/05/01 00:52:01 UTC
Re: [I] [Bug]: .xs() method on DeferredSeries and DeferredDataFrame doesn't work right when returning single items [beam]
tvalentyn commented on issue #28559:
URL: https://github.com/apache/beam/issues/28559#issuecomment-2087785335
Seeing a similar error on a different operation:
```
from apache_beam.dataframe.doctests import teststring
test = """
With a DataFrame
>>> df = pd.DataFrame({'a': [1, 2, 2, 3], 'b': [3, 4, 4, 4]},
... index=['cat', 'dog', 'dog', 'mouse'])
>>> df
a b
cat 1 3
dog 2 4
dog 2 4
mouse 3 4
>>> df.kurt()
a 1.5
b 4.0
dtype: float64
Passes on Beam with axis=1
>>> df = pd.DataFrame({'a': [1, 2], 'b': [3, 4], 'c': [3, 4], 'd': [1, 2]},
... index=['cat', 'dog'])
>>> df.kurt(axis=1)
cat -6.0
dog -6.0
dtype: float64
Fails on Beam with axis=None
>>> df.kurt(axis=None).round(6)
-0.988693
"""
teststring(test)
```
```
AttributeError: '_DeferredScalar' object has no attribute 'round'
```
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org