Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.12.0
Description
It would be convenient to get access to the entire slice of dimension names via a DimNames() []string method, in addition to the existing DimName(i int) string method. Here is a patch:
--- a/go/arrow/tensor/tensor.go
+++ b/go/arrow/tensor/tensor.go
@@ -52,6 +52,9 @@ type Interface interface {
{{ // DimName returns the name of the i-th dimension.}}
{{ DimName(i int) string}}
+ // DimNames returns the full slice of dimension names.
+ DimNames() []string
+
{{ DataType() arrow.DataType}}
{{ Data() *array.Data}}
{{@@ -102,6 +105,7 @@ func (tb *tensorBase) Shape() []int64 { return tb.shape }}}
{{ func (tb *tensorBase) Strides() []int64 { return tb.strides }}}
{{ func (tb *tensorBase) NumDims() int { return len(tb.shape) }}}
{{ func (tb *tensorBase) DimName(i int) string { return tb.names[i] }}}
{{+func (tb *tensorBase) DimNames() []string { return tb.names }}}
{{ func (tb *tensorBase) DataType() arrow.DataType { return tb.dtype }}}
{{ func (tb *tensorBase) Data() *array.Data { return tb.data }}}
Attachments
Issue Links
- links to