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

BUG: iat/at broken for PeriodIndex #4390

Closed
cpcloud opened this issue Jul 28, 2013 · 2 comments · Fixed by #4394

Comments

@cpcloud
Copy link
Member

commented Jul 28, 2013

In [9]: s = Series(randn(10), index=period_range('1/1/2001', periods=10))

In [10]: s
Out[10]:
2001-01-01   -0.677
2001-01-02    0.058
2001-01-03   -1.200
2001-01-04   -1.152
2001-01-05   -2.646
2001-01-06   -1.068
2001-01-07   -1.232
2001-01-08    0.452
2001-01-09    0.476
2001-01-10   -1.387
Freq: D, dtype: float64

In [11]: s.iat[0] # throws a KeyError
@cpcloud

This comment has been minimized.

Copy link
Member Author

commented Jul 28, 2013

i guess this is ambiguous tho since period objects are really just fancy ints, still should work tho

@jreback should the conversion happen in the engine get_value in index.pyx or should there be check in the ScalarIndexer class for the ordinal attribute

@jreback

This comment has been minimized.

Copy link
Contributor

commented Jul 28, 2013

no...the problem here is that the index is int based, so it tries to look up based the key (which is wrong)

i'll look at this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.