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

Panel constructed with a None as a dict value throws an error #2075

Closed
wants to merge 1 commit into from

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Oct 16, 2012

Python 2.7.3 (default, Jun 21 2012, 07:50:29)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import pandas
print pandas.version
0.8.1
print pandas.Panel(dict(a = None, b = pandas.DataFrame(index=[1,2,3],columns=[1,2,3])))
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/site-packages/pandas-0.8.1-py2.7-linux-x86_64.egg/pandas/core/panel.py", line 219, in init
mgr = self._init_dict(data, passed_axes, dtype=dtype)
File "/usr/local/lib/python2.7/site-packages/pandas-0.8.1-py2.7-linux-x86_64.egg/pandas/core/panel.py", line 256, in _init_dict
major = _extract_axis(data, axis=0)
File "/usr/local/lib/python2.7/site-packages/pandas-0.8.1-py2.7-linux-x86_64.egg/pandas/core/panel.py", line 1396, in _extract_axis
raw_lengths.append(v.shape[axis])
AttributeError: 'NoneType' object has no attribute 'shape'

same behavior exists in 0.9
added tests and fixes for this case (and the pathological case of constructing with dict(a=None))

…he same behavior)

Python 2.7.3 (default, Jun 21 2012, 07:50:29)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
>>> print pandas.__version__
0.8.1
>>> print pandas.Panel(dict(a = None, b = pandas.DataFrame(index=[1,2,3],columns=[1,2,3])))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/pandas-0.8.1-py2.7-linux-x86_64.egg/pandas/core/panel.py", line 219, in __init__
    mgr = self._init_dict(data, passed_axes, dtype=dtype)
  File "/usr/local/lib/python2.7/site-packages/pandas-0.8.1-py2.7-linux-x86_64.egg/pandas/core/panel.py", line 256, in _init_dict
    major = _extract_axis(data, axis=0)
  File "/usr/local/lib/python2.7/site-packages/pandas-0.8.1-py2.7-linux-x86_64.egg/pandas/core/panel.py", line 1396, in _extract_axis
    raw_lengths.append(v.shape[axis])
AttributeError: 'NoneType' object has no attribute 'shape'

added tests and fixes for this case (and the pathological case of constructing with dict(a=None))
@wesm
Copy link
Member

wesm commented Nov 2, 2012

Any idea why the file modes got changed to 755 from 644?

@wesm wesm closed this Nov 2, 2012
@jreback
Copy link
Contributor Author

jreback commented Nov 2, 2012

no idea

I can be reached on my cell 917-971-6387

On Nov 2, 2012, at 4:47 PM, Wes McKinney notifications@github.com wrote:

Any idea why the file modes got changed to 755 from 644?


Reply to this email directly or view it on GitHub.

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

Successfully merging this pull request may close these issues.

2 participants