Skip to content

BUG: Fix a bug when indexing np.nan via loc/iloc (GH5016) #5018

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

Merged
merged 1 commit into from
Sep 28, 2013

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Sep 28, 2013

closes #5016

if not key in ax:
error()
except (TypeError) as e1:
if str(e1).startswith('unorderable'):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jtratner I had to do this to convert the TypeError (because in py3 it raises differently in 2), is there a 'better' way to detect this?

Copy link
Member

Choose a reason for hiding this comment

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

what can't be ordered here?

Copy link
Contributor

Choose a reason for hiding this comment

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

this is a Python 2/Python 3 difference.

None < 5 is True in Python 2, but is a TypeError in Python 3.

Copy link
Member

Choose a reason for hiding this comment

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

why not make a subclass of typeerror and just catch the different instances how you wnat to

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to pass type errors upward but as u noticed above the comparison raises in py3 but not in 2
not so easy to trap the type error on the cases that we want

jreback added a commit that referenced this pull request Sep 28, 2013
BUG: Fix a bug when indexing np.nan via loc/iloc (GH5016)
@jreback jreback merged commit c2ed35a into pandas-dev:master Sep 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NaN in columns produces TypeError
3 participants