diff --git a/lib/charty/table_adapters/pandas_adapter.rb b/lib/charty/table_adapters/pandas_adapter.rb index 1fec9c31..5ce59e55 100644 --- a/lib/charty/table_adapters/pandas_adapter.rb +++ b/lib/charty/table_adapters/pandas_adapter.rb @@ -208,7 +208,12 @@ def [](key) when PyCall::Tuple key else - PyCall::Tuple.new(*Array(key)) + key = Array(key) + if key.length == 1 && key[0].is_a?(Integer) + key[0] + else + PyCall::Tuple.new(*key) + end end Charty::Table.new(@groupby.get_group(key)) end