Skip to content

BUG: duplicate indexing with embedded non-orderables (#17610) #17851

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 1 commit into from
Closed

BUG: duplicate indexing with embedded non-orderables (#17610) #17851

wants to merge 1 commit into from

Conversation

gloryfromca
Copy link
Contributor

@gloryfromca gloryfromca commented Oct 12, 2017

BUG: duplicate indexing with embedded non-orderables (#17610)

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@codecov
Copy link

codecov bot commented Oct 12, 2017

Codecov Report

Merging #17851 into master will decrease coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17851      +/-   ##
==========================================
- Coverage   91.25%   91.21%   -0.05%     
==========================================
  Files         163      163              
  Lines       50038    50039       +1     
==========================================
- Hits        45661    45641      -20     
- Misses       4377     4398      +21
Flag Coverage Δ
#multiple 89.01% <100%> (-0.03%) ⬇️
#single 40.26% <0%> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/core/series.py 94.99% <100%> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/plotting/_converter.py 63.38% <0%> (-1.82%) ⬇️
pandas/core/frame.py 97.75% <0%> (-0.1%) ⬇️

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 7e159ae...10a60ae. Read the comment docs.

@codecov
Copy link

codecov bot commented Oct 12, 2017

Codecov Report

Merging #17851 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17851      +/-   ##
==========================================
- Coverage   91.23%   91.22%   -0.02%     
==========================================
  Files         163      163              
  Lines       50112    50112              
==========================================
- Hits        45722    45713       -9     
- Misses       4390     4399       +9
Flag Coverage Δ
#multiple 89.03% <100%> (ø) ⬆️
#single 40.31% <50%> (-0.06%) ⬇️
Impacted Files Coverage Δ
pandas/core/series.py 95% <100%> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.75% <0%> (-0.1%) ⬇️

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 51c5f4d...222dd37. Read the comment docs.

@gfyoung gfyoung added Bug Indexing Related to indexing on series/frames, not to indexes themselves labels Oct 12, 2017
@@ -546,6 +546,21 @@ def test_getitem_setitem_periodindex(self):
result[4:8] = ts[4:8]
assert_series_equal(result, ts)

def test_getitem_with_duplicates_indices(self):
s = pd.Series({1: 12, 2: [1, 2, 2, 3]})
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 add the github issue number as a comment here?

@@ -626,9 +626,10 @@ def __getitem__(self, key):
# we need to box if we have a non-unique index here
# otherwise have inline ndarray/lists
if not self.index.is_unique:
result = self._constructor(
result, index=[key] * len(result),
Copy link
Contributor

Choose a reason for hiding this comment

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

you need to do something like

index = self.index[self.index.get_loc(key)]

@@ -978,6 +978,7 @@ Indexing
- Bug in :meth:`DataFrame.first_valid_index` and :meth:`DataFrame.last_valid_index` when no valid entry (:issue:`17400`)
- Bug in :func:`Series.rename` when called with a callable, incorrectly alters the name of the ``Series``, rather than the name of the ``Index``. (:issue:`17407`)
- Bug in :func:`String.str_get` raises ``IndexError`` instead of inserting NaNs when using a negative index. (:issue:`17704`)
Copy link
Contributor

Choose a reason for hiding this comment

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

move to 0.21.1

@jreback
Copy link
Contributor

jreback commented Nov 25, 2017

can you rebase / update

@gloryfromca gloryfromca closed this Dec 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants