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

squeeze works on 0 length arrays #11230

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@max-sixty
Contributor

max-sixty commented Oct 3, 2015

fixes: #11229.
fixes: #8999.

Also a better implementation that avoids ix

Should I add to What's new for 0.17? Or is that closed now?

@jreback

View changes

Show outdated Hide outdated pandas/tests/test_generic.py Outdated
@max-sixty

This comment has been minimized.

Show comment
Hide comment
@max-sixty

max-sixty Oct 3, 2015

Contributor

@jreback tests added

Contributor

max-sixty commented Oct 3, 2015

@jreback tests added

@max-sixty

This comment has been minimized.

Show comment
Hide comment
@max-sixty

max-sixty Oct 3, 2015

Contributor

What should the behavior be here:

empty_series=pd.Series([], name='five').squeeze()

numpy returns itself:

In [18]: pd.np.empty(0)
Out[18]: array([], dtype=float64)

In [19]: pd.np.empty(0).squeeze()
Out[19]: array([], dtype=float64)

...which is the current pandas implementation too.
But I could see None being acceptable here

Contributor

max-sixty commented Oct 3, 2015

What should the behavior be here:

empty_series=pd.Series([], name='five').squeeze()

numpy returns itself:

In [18]: pd.np.empty(0)
Out[18]: array([], dtype=float64)

In [19]: pd.np.empty(0).squeeze()
Out[19]: array([], dtype=float64)

...which is the current pandas implementation too.
But I could see None being acceptable here

@jreback

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Oct 3, 2015

Contributor

no squeeze does not return a scalar always a Series (or high dim)

Contributor

jreback commented Oct 3, 2015

no squeeze does not return a scalar always a Series (or high dim)

@max-sixty

This comment has been minimized.

Show comment
Hide comment
@max-sixty

max-sixty Oct 3, 2015

Contributor

OK @jreback, test added for that too

Contributor

max-sixty commented Oct 3, 2015

OK @jreback, test added for that too

@TomAugspurger

This comment has been minimized.

Show comment
Hide comment
@TomAugspurger

TomAugspurger Oct 3, 2015

Contributor

Also closes #8999

Contributor

TomAugspurger commented Oct 3, 2015

Also closes #8999

@jreback jreback added this to the 0.17.1 milestone Oct 3, 2015

@jreback

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Oct 3, 2015

Contributor

their is a whatsnew for 0.17.1 pls add a release note.

Contributor

jreback commented Oct 3, 2015

their is a whatsnew for 0.17.1 pls add a release note.

@max-sixty

This comment has been minimized.

Show comment
Hide comment
@max-sixty

max-sixty Oct 4, 2015

Contributor

@jreback what's new added, commits squashed, ready to go from this end

Contributor

max-sixty commented Oct 4, 2015

@jreback what's new added, commits squashed, ready to go from this end

@jreback

View changes

Show outdated Hide outdated doc/source/whatsnew/v0.17.1.txt Outdated
@max-sixty

This comment has been minimized.

Show comment
Hide comment
@max-sixty

max-sixty Oct 5, 2015

Contributor

@jreback done!

Contributor

max-sixty commented Oct 5, 2015

@jreback done!

@jreback

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Oct 9, 2015

Contributor

merged via aa94ae4

thanks!

Contributor

jreback commented Oct 9, 2015

merged via aa94ae4

thanks!

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