Skip to content

transpose() of single element array - GDL behaviour differs to IDL #2182

@rsiddans

Description

@rsiddans

IDL/GDL transpose() function behaves differently when single element array is passed in:

IDL> a=fltarr(1)
IDL> help,transpose(a)
FLOAT = Array[1]

GDL> a=fltarr(1)
GDL> help,transpose(a)
FLOAT = Array[1, 1]

(I.e. GDL keeps the 2nd 1-element dimension, IDL drops it)

Note that GDL behaves the same as IDL if the argument is 2d but with 1st dimension length=1
(both drop the last dimension):

IDL> a=fltarr(1,2)
IDL> help,transpose(a)
FLOAT = Array[2]

GDL> a=fltarr(1,2)
GDL> help,transpose(a)
FLOAT = Array[2]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions