Skip to content

Natural name convention broken for "size" in non-interactive mode. #9367

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

Closed
mamikonyan opened this issue Jan 28, 2015 · 4 comments
Closed

Natural name convention broken for "size" in non-interactive mode. #9367

mamikonyan opened this issue Jan 28, 2015 · 4 comments

Comments

@mamikonyan
Copy link

If there is a column named "size", the member syntax return the NumPy .size property instead of the contents of the column:

$ python -c "import pandas; df=pandas.DataFrame({'size':range(3)}); print df.size; print df['size']"

prints

3
0    0
1    1
2    2
Name: size, dtype: int64
@shoyer
Copy link
Member

shoyer commented Jan 28, 2015

This is as expected: please read the "Warning" section of the documentation on attribute style access:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access

@shoyer shoyer closed this as completed Jan 28, 2015
@mamikonyan
Copy link
Author

size is not an "existing method name." I don't quite understand which of the conditions in the warning to which you pointed covers this case. Furthermore, this used to work in previous versions.

@jreback
Copy link
Contributor

jreback commented Jan 28, 2015

@mamikony see here: #8847
this was for Numpy compat

@mamikonyan
Copy link
Author

I see, 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

3 participants