Skip to content

Some functions implemented through reduction operation arise exceptions #1953

@YarShev

Description

@YarShev

Describe the problem

Some functions (such as median, skew, std, var, sum, prod) arise an exception when level specified.

Source code / logs

import modin.pandas as pd
import pandas
arrays = [['1', '1', '1', '2', '2', '2', '3', '3', '3'], ['1', '2', '3', '4', '5', '6', '7', '8', '9']]
ps = pandas.Series([3,3,3,3,3,3,3,3,3], index=arrays)
ms = pd.Series([3,3,3,3,3,3,3,3,3], index=arrays)
ps.std(level=0)
1    0.0
2    0.0
3    0.0
dtype: float64
ms.std(level=0) # the same exception is arisen for median, skew, var, sum, prod
ValueError: Length mismatch: Expected axis has 3 elements, new values have 1 elements
arrays = [['1', '1', '2', '2'], ['1', '2', '3', '4']]
pdf = pandas.DataFrame([[1,2,3,4], [1,2,3,4], [1,2,3,4], [1,2,3,4]], index=arrays)
mdf = pd.DataFrame([[1,2,3,4], [1,2,3,4], [1,2,3,4], [1,2,3,4]], index=arrays)
pdf.std(level=0)
     0    1    2    3
1  0.0  0.0  0.0  0.0
2  0.0  0.0  0.0  0.0
mdf.std(level=0) # the same exception is arisen for median, skew, var, sum, prod
ValueError: Length mismatch: Expected axis has 2 elements, new values have 1 elements

Metadata

Metadata

Assignees

Labels

bug 🦗Something isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions