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

DataFrame with no rows gives error when trying to view it #2791

Closed
grgsolymosi opened this issue Oct 31, 2015 · 3 comments
Closed

DataFrame with no rows gives error when trying to view it #2791

grgsolymosi opened this issue Oct 31, 2015 · 3 comments

Comments

@grgsolymosi
Copy link

If I construct a DF like this:

iv_bd = pd.DataFrame(columns=['Jan','Feb','Mar'])

It causes an internal error instead of showing something like e.g. "empty Dataframe"

Spyder Internal Console

This console is used to report application
internal errors and to inspect Spyder
internals with the following commands:
  spy.app, spy.window, dir(spy)

Please don't use it to run your code

>>> /home/george/anaconda/lib/python2.7/site-packages/nbformat/current.py:19: UserWarning: nbformat.current is deprecated.

- use nbformat for read/write/validate public API
- use nbformat.vX directly to composing notebooks of a particular version

  """)
Traceback (most recent call last):
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dicteditor.py", line 503, in createEditor
    if not editor.setup_and_check(value, title=key):
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dataframeeditor.py", line 494, in setup_and_check
    self.dataModel = DataFrameModel(data, parent=self)
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dataframeeditor.py", line 90, in __init__
    self.max_min_col_update()
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dataframeeditor.py", line 124, in max_min_col_update
    mask = float_intran & (~ self.complex_intran)
  File "/home/george/anaconda/lib/python2.7/site-packages/pandas/core/generic.py", line 639, in __invert__
    arr = operator.inv(_values_from_object(self))
TypeError: ufunc 'invert' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Traceback (most recent call last):
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dicteditor.py", line 503, in createEditor
    if not editor.setup_and_check(value, title=key):
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dataframeeditor.py", line 494, in setup_and_check
    self.dataModel = DataFrameModel(data, parent=self)
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dataframeeditor.py", line 90, in __init__
    self.max_min_col_update()
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dataframeeditor.py", line 124, in max_min_col_update
    mask = float_intran & (~ self.complex_intran)
  File "/home/george/anaconda/lib/python2.7/site-packages/pandas/core/generic.py", line 639, in __invert__
    arr = operator.inv(_values_from_object(self))
TypeError: ufunc 'invert' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Traceback (most recent call last):
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dicteditor.py", line 503, in createEditor
    if not editor.setup_and_check(value, title=key):
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dataframeeditor.py", line 494, in setup_and_check
    self.dataModel = DataFrameModel(data, parent=self)
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dataframeeditor.py", line 90, in __init__
    self.max_min_col_update()
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dataframeeditor.py", line 124, in max_min_col_update
    mask = float_intran & (~ self.complex_intran)
  File "/home/george/anaconda/lib/python2.7/site-packages/pandas/core/generic.py", line 639, in __invert__
    arr = operator.inv(_values_from_object(self))
TypeError: ufunc 'invert' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Traceback (most recent call last):
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dicteditor.py", line 503, in createEditor
    if not editor.setup_and_check(value, title=key):
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dataframeeditor.py", line 494, in setup_and_check
    self.dataModel = DataFrameModel(data, parent=self)
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dataframeeditor.py", line 90, in __init__
    self.max_min_col_update()
  File "/home/george/anaconda/lib/python2.7/site-packages/spyderlib/widgets/dataframeeditor.py", line 124, in max_min_col_update
    mask = float_intran & (~ self.complex_intran)
  File "/home/george/anaconda/lib/python2.7/site-packages/pandas/core/generic.py", line 639, in __invert__
    arr = operator.inv(_values_from_object(self))
TypeError: ufunc 'invert' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

Spyder 2.3.7
Python 2.7.10 64bits, Qt 4.8.7, PyQt4 (API v2) 4.11.4 on Linux
Ubuntu 14.04 LTS

@ccordoba12
Copy link
Member

Thanks for reporting. I'll take a look at this one as soon as I can :-)

@ccordoba12 ccordoba12 modified the milestones: v2.3.8, v3.0 Nov 16, 2015
@ccordoba12
Copy link
Member

I'll fix this problem in version 2.3.8. Thanks for your patience.

@ccordoba12 ccordoba12 changed the title Empty preconstructed pandas results in error in Variable Explorer DataFrame with no rows gives error when trying to view it Nov 16, 2015
ccordoba12 added a commit that referenced this issue Nov 16, 2015
@grgsolymosi
Copy link
Author

Thank you for your work, Sir.

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

No branches or pull requests

2 participants