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

ENH: Add FrozenList.union and .difference #23394

Merged
merged 1 commit into from
Nov 3, 2018

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented Oct 28, 2018

Re-attempt of #15506.

Hopefully no doc slowdowns on Travis this time 🙏 ! (xref #15559)

Closes #15475.

No deprecation of __add__ and __iadd__ because we rely on overloading + internally when operating on array-likes (in general) in some cases (e.g. here). In some cases, that array-like will be FrozenList.

@pep8speaks
Copy link

Hello @gfyoung! Thanks for submitting the PR.

@gfyoung gfyoung added this to the 0.24.0 milestone Oct 28, 2018
@codecov
Copy link

codecov bot commented Oct 28, 2018

Codecov Report

Merging #23394 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #23394      +/-   ##
==========================================
+ Coverage   92.21%   92.21%   +<.01%     
==========================================
  Files         161      161              
  Lines       51187    51191       +4     
==========================================
+ Hits        47202    47206       +4     
  Misses       3985     3985
Flag Coverage Δ
#multiple 90.65% <100%> (ø) ⬆️
#single 42.21% <57.14%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/frozen.py 92.1% <100%> (+0.43%) ⬆️

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 9019582...c1a375e. Read the comment docs.

@gfyoung
Copy link
Member Author

gfyoung commented Nov 1, 2018

@jreback @jorisvandenbossche : Any thoughts on this?

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

looks good.

pandas/core/indexes/frozen.py Outdated Show resolved Hide resolved
pandas/tests/indexes/test_frozen.py Show resolved Hide resolved
@gfyoung
Copy link
Member Author

gfyoung commented Nov 1, 2018

@jreback : Changes addressed, and all is green. PTAL.

@gfyoung
Copy link
Member Author

gfyoung commented Nov 2, 2018

@jreback : Any thoughts on this?

@jbrockmendel
Copy link
Member

LGTM

@jreback jreback merged commit 06c8643 into pandas-dev:master Nov 3, 2018
@jreback
Copy link
Contributor

jreback commented Nov 3, 2018

thanks @gfyoung

thoo added a commit to thoo/pandas that referenced this pull request Nov 3, 2018
…xamples

* repo_org/master: (66 commits)
  CLN: doc string (pandas-dev#23469)
  DOC: Add cookbook entry for triangular correlation matrix (GH22840) (pandas-dev#23032)
  add number of Errors, Warnings to scripts/validate_docstrings.py (pandas-dev#23150)
  BUG: Allow freq conversion from dt64 to period (pandas-dev#23460)
  ENH: Add FrozenList.union and .difference (pandas-dev#23394)
  REF: cython cleanup, typing, optimizations (pandas-dev#23464)
  strictness and checks for Timedelta _simple_new (pandas-dev#23433)
  Fixing flake8 problems new to flake8 3.6.0 (pandas-dev#23472)
  DOC: Updating the docstring of Series.dot  (pandas-dev#22890)
  TST: Fixturize series/test_analytics.py (pandas-dev#22755)
  BUG/ENH: Handle NonexistentTimeError in date rounding (pandas-dev#23406)
  PERF: speed up concat on Series by making _get_axis_number() a classmethod (pandas-dev#23404)
  REF: Remove DatetimelikeArrayMixin._shallow_copy (pandas-dev#23430)
  REF: strictness/simplification in DatetimeArray/Index _simple_new (pandas-dev#23431)
  REF: cython cleanup, typing, optimizations (pandas-dev#23456)
  TST: tweak Hypothesis configuration and idioms (pandas-dev#23441)
  BUG: fix HDFStore.append with all empty strings error (GH12242) (pandas-dev#23435)
  TST: Skip 32bit failing IntervalTree tests (pandas-dev#23442)
  BUG: Deprecate nthreads argument (pandas-dev#23112)
  style: fix import format at pandas/core/reshape (pandas-dev#23387)
  ...
@gfyoung gfyoung deleted the frozen-list-union-diff branch November 3, 2018 17:54
gfyoung added a commit to forking-repos/pandas that referenced this pull request Nov 4, 2018
gfyoung added a commit to forking-repos/pandas that referenced this pull request Nov 4, 2018
gfyoung added a commit to forking-repos/pandas that referenced this pull request Nov 4, 2018
gfyoung added a commit to forking-repos/pandas that referenced this pull request Nov 4, 2018
gfyoung added a commit to forking-repos/pandas that referenced this pull request Nov 4, 2018
jorisvandenbossche pushed a commit that referenced this pull request Nov 5, 2018
- ``ExcelWriter`` now accepts ``mode`` as a keyword argument, enabling append to existing workbooks when using the ``openpyxl`` engine (:issue:`3441`)

- ``FrozenList`` has gained the ``.union()`` and ``.difference()`` methods. This functionality greatly simplifies groupby's that rely on explicitly excluding certain columns. See :ref:`Splitting an object into groups
Copy link
Member

Choose a reason for hiding this comment

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

This still uses FrozenList, a term that is nowhere mentioned currently in the docs.

Personally, that also indicates a problem with this feature for me. I think we should either properly document FrozenList its methods in the pandas API, or either not have additional methods on it (compared to list).

JustinZhengBC pushed a commit to JustinZhengBC/pandas that referenced this pull request Nov 14, 2018
JustinZhengBC pushed a commit to JustinZhengBC/pandas that referenced this pull request Nov 14, 2018
tm9k1 pushed a commit to tm9k1/pandas that referenced this pull request Nov 19, 2018
tm9k1 pushed a commit to tm9k1/pandas that referenced this pull request Nov 19, 2018
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants