Skip to content

BUG: Error when specifying int index containing NaN #15616

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

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented Mar 8, 2017

Finally got around to patching this. Partially addresses #15187.

@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions Indexing Related to indexing on series/frames, not to indexes themselves Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Mar 8, 2017

dtype = self.dtype
if self._is_numeric_dtype and np.any(isnull(values)):
# We can't coerce to the numeric dtype of "self" (unless
Copy link
Contributor

Choose a reason for hiding this comment

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

-> isnull(values).any()

Copy link
Member Author

Choose a reason for hiding this comment

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

Breaks if values is a scalar.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, that's annoying. ok then.

@jreback
Copy link
Contributor

jreback commented Mar 8, 2017

looks good. maybe some test cases for the fail conditions that you are now catching?

@gfyoung
Copy link
Member Author

gfyoung commented Mar 8, 2017

maybe some test cases for the fail conditions that you are now catching?

Ah, good catch. I thought I had added some. Will do.

@codecov-io
Copy link

codecov-io commented Mar 9, 2017

Codecov Report

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

@@            Coverage Diff             @@
##           master   #15616      +/-   ##
==========================================
- Coverage   91.02%      91%   -0.02%     
==========================================
  Files         143      143              
  Lines       49324    49334      +10     
==========================================
  Hits        44897    44897              
- Misses       4427     4437      +10
Impacted Files Coverage Δ
pandas/indexes/base.py 96.24% <100%> (+0.02%)
pandas/io/gbq.py 25% <0%> (-58.34%)
pandas/tools/merge.py 91.76% <0%> (-0.35%)
pandas/core/frame.py 97.87% <0%> (-0.1%)
pandas/core/common.py 91.3% <0%> (+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 5667a3a...195b830. Read the comment docs.

@gfyoung
Copy link
Member Author

gfyoung commented Mar 9, 2017

@jreback : Added tests, and everything is green.

@jreback jreback added this to the 0.20.0 milestone Mar 10, 2017
@jreback jreback closed this in 15e8e9a Mar 10, 2017
@jreback
Copy link
Contributor

jreback commented Mar 10, 2017

thanks!

@gfyoung gfyoung deleted the nan-int-index branch March 10, 2017 14:43
AnkurDedania pushed a commit to AnkurDedania/pandas that referenced this pull request Mar 21, 2017
xref pandas-dev#15187.

Author: gfyoung <[email protected]>

Closes pandas-dev#15616 from gfyoung/nan-int-index and squashes the following commits:

195b830 [gfyoung] BUG: Error when specifying int index containing NaN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions Indexing Related to indexing on series/frames, not to indexes themselves Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants