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

DOC: document level-dropping for empty columns #11424

Open
chris-b1 opened this issue Oct 24, 2015 · 1 comment
Open

DOC: document level-dropping for empty columns #11424

chris-b1 opened this issue Oct 24, 2015 · 1 comment
Labels
API Design Docs Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex

Comments

@chris-b1
Copy link
Contributor

I might have missed it, but I couldn't find this behavior documented anywhere. It is occasionally useful, if a bit magical.

In [1]: df1 = pd.DataFrame([1,2,3], columns=[['a'],['b']])

In [2]: df2 = pd.DataFrame([1,2,3], columns=[['a'],['']])

In [5]: df1['a'], type(df1['a'])
Out[5]: 
(   b
 0  1
 1  2
 2  3, pandas.core.frame.DataFrame)

In [6]: df2['a'], type(df2['a'])
Out[6]: 
(0    1
 1    2
 2    3
 Name: a, dtype: int64, pandas.core.series.Series)
@jreback
Copy link
Contributor

jreback commented Oct 26, 2015

yeh '' is an empty level for dropping purposes. The empty level concept is much better now-adays IOW NaN is pretty good. So not really sure this is necessary any longer.

All of that said. This is pretty buried in pretty tangled code.

@jreback jreback added Indexing Related to indexing on series/frames, not to indexes themselves API Design MultiIndex labels Oct 26, 2015
@jreback jreback added this to the Next Major Release milestone May 6, 2017
@mroeschke mroeschke removed this from the Contributions Welcome milestone Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Docs Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex
Projects
None yet
Development

No branches or pull requests

4 participants