Skip to content

Reduction functions doesn't work correctly if numeric_only!=False #1976

Closed
@anmyachev

Description

@anmyachev

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10
  • Modin installed from (source or binary): source
  • Modin version: 0.8.0+35.g90a3445.dirty
  • Python version: Python 3.7.6
  • Exact command to reproduce: python test.py

test.py:

import pandas
import numpy as np
import modin.pandas as pd

data = {
    "float_col": [np.NaN, 9.4, 10.1, np.NaN],
    "str_col": ["a", np.NaN, "c", "d"],
    "bool_col": [False, True, True, False],
}

modin_df = pd.DataFrame(data)
pandas_df = pandas.DataFrame(data)

print(f"pandas:\n{pandas_df.sum(min_count=1)}")
print(f"modin:\n{modin_df.sum(min_count=1)}")

Describe the problem

Different from pandas result.

Pandas result:

pandas:
float_col    19.5
bool_col      2.0
dtype: float64

Source code / logs

Modin exception:

Traceback (most recent call last):
  File "test.py", line 15, in <module>
    print(f"modin:\n{modin_df.sum(min_count=1)}")
  File "modin\pandas\base.py", line 3512, in __str__
    return repr(self)
  File "modin\pandas\series.py", line 307, in __repr__
    temp_df = self._build_repr_df(num_rows, num_cols)
  File "modin\pandas\base.py", line 108, in _build_repr_df
    return self.iloc[indexer]._query_compiler.to_pandas()
  File "modin\backends\pandas\query_compiler.py", line 191, in to_pandas
    return self._modin_frame.to_pandas()
  File "modin\engines\base\frame\data.py", line 1801, in to_pandas
    "Internal and external indices do not match.",
  File "modin\error_message.py", line 54, in catch_bugs_and_request_email
    " caused this error.\n{}".format(extra_log)
Exception: Internal Error. Please email [email protected] with the traceback and command that caused this error.
Internal and external indices do not match.

Metadata

Metadata

Assignees

Labels

P1Important tasks that we should complete soonbug 🦗Something isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions