Skip to content

[Python] Does Array.unique preserve order? #44663

Open
@MarcoGorelli

Description

@MarcoGorelli

Describe the usage question you have. Please include as many useful details as possible.

It looks like Array.unique maintains the order of elements' appearance:

In [30]: pa.array([1, 1, 2, 2, 1, 4, 2]).unique()
Out[30]:
<pyarrow.lib.Int64Array object at 0x7f48661a9900>
[
  1,
  2,
  4
]

Is this guaranteed to always be the case? If so, would you be open to documenting the guarantee?

Component(s)

Python

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions