Skip to content

ENH: .squeeze accepts axis parameter #15335

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
wants to merge 2 commits into from

Conversation

kernc
Copy link
Contributor

@kernc kernc commented Feb 7, 2017

@jorisvandenbossche
Copy link
Member

@kernc Is there an issue for this?
Can you give some rationale? Or show an example use case.

@kernc
Copy link
Contributor Author

kernc commented Feb 8, 2017

Thanks. Now it is: #15339.

@kernc kernc force-pushed the squeeze_axis_param branch from 51cc482 to cc018c9 Compare February 8, 2017 00:02

Parameters
----------
axis : None or int or tuple of ints, optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so you don't need virtually any of this validation, simply

axis = self._get_axis_number(axis), this can only accept a single axis (or None by-default)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like the pushed change?

@kernc kernc force-pushed the squeeze_axis_param branch from 1f91721 to 44d3c54 Compare February 8, 2017 01:25
@codecov-io
Copy link

codecov-io commented Feb 8, 2017

Codecov Report

Merging #15335 into master will increase coverage by <.01%.

@@            Coverage Diff             @@
##           master   #15335      +/-   ##
==========================================
+ Coverage   86.32%   86.32%   +<.01%     
==========================================
  Files         141      141              
  Lines       51165    51163       -2     
==========================================
- Hits        44169    44168       -1     
+ Misses       6996     6995       -1
Impacted Files Coverage Δ
pandas/compat/numpy/function.py 94.19% <ø> (-0.08%)
pandas/core/generic.py 96.33% <100%> (ø)
pandas/core/common.py 91.36% <ø> (+0.33%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 153da50...44d3c54. Read the comment docs.

@jreback jreback added the Reshaping Concat, Merge/Join, Stack/Unstack, Explode label Feb 8, 2017
@jreback jreback added this to the 0.20.0 milestone Feb 8, 2017
@jreback jreback closed this in 87c2c2a Feb 8, 2017
@jreback
Copy link
Contributor

jreback commented Feb 8, 2017

thanks!

Parameters
----------
axis : None or int, optional
The axis to squeeze if 1-sized.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what the default is (None -> squeeze all 1-sized dimensions)

@jorisvandenbossche
Copy link
Member

Added a 2 comments on the documentation (see above and also the comment on the merged commit: 87c2c2a#commitcomment-20800784).
@kernc would you like to do a follow-up PR?

AnkurDedania pushed a commit to AnkurDedania/pandas that referenced this pull request Mar 21, 2017
closes pandas-dev#15339

Author: Kernc <[email protected]>

Closes pandas-dev#15335 from kernc/squeeze_axis_param and squashes the following commits:

44d3c54 [Kernc] fixup! ENH: .squeeze accepts axis parameter
cc018c9 [Kernc] ENH: .squeeze accepts axis parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants