Skip to content

IndexError when calling modin.pandas.DataFrame.values.all() #3896

@elp-29

Description

@elp-29

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Microsoft Windows 10 Entreprise 10.0.18363 N/A build 18363
  • Modin version (modin.__version__): 0.12.1
  • Python version: Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54)
  • Code we can use to reproduce:
from pyreadline import Readline
readline = Readline()
import numpy as np
import ray
import modin.pandas as pd

ray.init()

df_movment_subset = pd.DataFrame([], columns=['Date transaction', 'Reference','Statut','MSISDN','Num Correspondant', 'Type', 'Movments.final.movmentAmount'])

if df_movment_subset['Type'].values.all() == 'Depot':
    print("Depot")
elif df_movment_subset['Type'].values.all() == 'Retrait':
    print("Retrait")
else:
    print("None")

Describe the problem

An IndexError: tuple index out of range is thrown
The same code with native pandas library will return 'None'

Source code / logs

UserWarning: `DataFrame.__getitem__` for empty DataFrame defaulting to pandas implementation.
To request implementation, send an email to [email protected].
UserWarning: Distributing <class 'pandas.core.series.Series'> object. This may take some time.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\TNTZ2660\AppData\Local\Programs\Python\Python38\lib\site-packages\modin\pandas\base.py", line 3076, in __getattribute__
    attr = super().__getattribute__(item)
  File "C:\Users\TNTZ2660\AppData\Local\Programs\Python\Python38\lib\site-packages\modin\pandas\series.py", line 546, in values
    return super(Series, self).to_numpy().flatten()
  File "C:\Users\TNTZ2660\AppData\Local\Programs\Python\Python38\lib\site-packages\modin\pandas\base.py", line 2694, in to_numpy
    return self._query_compiler.to_numpy(
  File "C:\Users\TNTZ2660\AppData\Local\Programs\Python\Python38\lib\site-packages\modin\core\storage_formats\pandas\query_compiler.py", line 338, in to_numpy
    arr = self._modin_frame.to_numpy(**kwargs)
  File "C:\Users\TNTZ2660\AppData\Local\Programs\Python\Python38\lib\site-packages\modin\core\dataframe\pandas\dataframe\dataframe.py", line 2282, in to_numpy
    return self._partition_mgr_cls.to_numpy(self._partitions, **kwargs)
  File "C:\Users\TNTZ2660\AppData\Local\Programs\Python\Python38\lib\site-packages\modin\core\execution\ray\generic\partitioning\partition_manager.py", line 51, in to_numpy
    n = partitions.shape[1]
IndexError: tuple index out of range

Metadata

Metadata

Labels

bug 🦗Something isn't workingpandas concordance 🐼Functionality that does not match pandas

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions