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

Lack of the way to check object identity #118

Open
mrkn opened this issue Apr 22, 2020 · 0 comments
Open

Lack of the way to check object identity #118

mrkn opened this issue Apr 22, 2020 · 0 comments
Assignees

Comments

@mrkn
Copy link
Owner

mrkn commented Apr 22, 2020

In Python, we can check object identity by x is y expression.
PyCall should provide a way to do it.

>> idx = Pandas::Index.new([*0...3])
>> idx
=> Int64Index([0, 1, 2], dtype='int64')
>> s = Pandas::Series.new([2.71, 3.14, 42.0], index: idx)
>> s.index.
>> s.index.equal?(idx)
=> false
>> PyCall.eval("lambda x, y: x is y").(idx, s.index)
=> true
@mrkn mrkn self-assigned this Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant