Comments (1)
Modin version checks
- I have checked that this issue has not already been reported.
- I have confirmed this bug exists on the latest released version of Modin.
- I have confirmed this bug exists on the main branch of Modin. (In order to do this you can follow this guide.)
Reproducible Example
import modin.pandas as pd data1=pd.read_excel('abc.xlsx', header=[0,1]) # multiple headers def anyFuncB(x): do something return x def anyFuncA(x) x.loc[data1[('col0','col1')].apply(anyFuncB)] #here cause the error, apply() results in a pd.Series data = pd.read_excel('def.xlsx') data.groupby(by='col0').apply(anyFuncA)Issue Description
By just applying dataframe0.apply(anyFunc0), everything was good.
After applying dataframe0.groupby().apply(anyFunc0), if another dataframe1 has multi index and it runs dataframe1[('col0', 'col1')].apply(anyFunc1), File "/usr/local/python3.10/lib/python3.10/site-packages/modin/pandas/series.py", line 713, in apply if result.name == self.index[0]: raises ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all(), because here result.name is a tuple with 2 items and self.index[0] is a numpy.int64, the result of comparison is a list contents two boolean values, my temp fix is adding following code:
elif return_type == "Series": try: if result.name == self.index[0]: result.name = None except: if (result.name == self.index[0]).all(): result.name = None
other solution could be to determine if result.name and self.index[0] is single value or not.
Expected Behavior
make the comparison correct
Error Logs
Installed Versions
solution modified to:
if isinstance(_ := (result.name == self.index[0]), np.ndarray):
if _.all():
result.name = None
elif _:
result.name = None
from modin.
Related Issues (20)
- Avoid unnecessary length checks in `df.squeeze`
- Run a subset of CI tests for all Python versions that Modin has declared supported on a scheduled basis.
- Upgrade github actions dependency versions HOT 1
- ValueError: The 'nrows' option is not supported with the 'pyarrow' engine HOT 4
- BUG: HOT 1
- Poor performance of df.insert and df.to_parquet HOT 23
- Pass sort parameter in stack to `query_compiler` from modin/pandas/dataframe.py
- BUG: columns mismatch after df.update
- Polars API
- BUG: Series.compare with differently named series raises ValueError, but should not HOT 1
- BUG: Broken links in Modin Usage Examples page HOT 3
- Using dynamic partitioning for broadcast_apply
- merge not supported HOT 1
- Add more granular lazy execution flags in query compiler
- why so slow compare to dask HOT 1
- Modin read_csv not loading the complete file (memory leak in file reading) HOT 1
- BUG: Apply on axis=1 causes "daemonic processes are not allowed to have children" on some operations on Dask engine, or launches Ray instance HOT 1
- modin with ray engine hang HOT 1
- Possible issue with `dropna(how="all")` not deleting data from partition on ray. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modin.