Skip to content

Error on PyCall::Series#[] with an include-end range #12

@mrkn

Description

@mrkn
>> s = Pandas::Series.new([*(10..40)%10], index: %w[x1 x2 x3 x4])
>> s
=>
x1    10
x2    20
x3    30
x4    40
dtype: int64
>> s["x2"..."x4"]
=>
x2    20
x3    30
x4    40
dtype: int64
>> s["x2".."x4"]
Traceback (most recent call last):
        7: from /Users/mrkn/.rbenv/versions/2.7/bin/irb:23:in `<main>'
        6: from /Users/mrkn/.rbenv/versions/2.7/bin/irb:23:in `load'
        5: from /Users/mrkn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/irb-1.2.3/exe/irb:11:in `<top (required)>'
        4: from (irb):120
        3: from /Users/mrkn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pandas-0.3.2/lib/pandas/series.rb:9:in `[]'
        2: from /Users/mrkn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pycall-1.3.0/lib/pycall/pyobject_wrapper.rb:79:in `[]'
        1: from /Users/mrkn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pycall-1.3.0/lib/pycall/pyobject_wrapper.rb:79:in `getitem'
TypeError (no implicit conversion of String into Integer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions