Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to explore a pandas DataFrame #10

Closed
lodagro opened this issue Sep 20, 2021 · 2 comments
Closed

Unable to explore a pandas DataFrame #10

lodagro opened this issue Sep 20, 2021 · 2 comments

Comments

@lodagro
Copy link

lodagro commented Sep 20, 2021

Describe the bug

A ValueError is raised when exploring a pandas DataFrame, which is related to objexplore.utils.is_selectable.

In [1]: import objexplore                                                      
In [2]: import pandas as pd                                                    
In [3]: df = pd.DataFrame()                                                    
In [4]: objexplore.utils.is_selectable(df)      

Traceback

ValueError                                Traceback (most recent call last)
<ipython-input-4-b894c6ec269f> in <module>
----> 1 objexplore.utils.is_selectable(df)

<...>/lib/python3.7/site-packages/objexplore/utils.py in is_selectable(obj)
      1 def is_selectable(obj):
----> 2     return obj not in (None, [], (), {}, set())

<...>/lib/python3.7/site-packages/pandas-1.0.5-py3.7-linux-x86_64.egg/pandas/core/generic.py in __nonzero__(self)
   1477     def __nonzero__(self):
   1478         raise ValueError(
-> 1479             f"The truth value of a {type(self).__name__} is ambiguous. "
   1480             "Use a.empty, a.bool(), a.item(), a.any() or a.all()."
   1481         )

ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

@kylepollina
Copy link
Owner

Thanks for the report, fix is in v1.4.4 - upgrade with pip install objexplore --upgrade and see if the bug persists.

Thank you!

@lodagro
Copy link
Author

lodagro commented Sep 20, 2021

Works fine now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants