Skip to content

Commit

Permalink
docs: show how Array.unique() keeps NULLs (#8766)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCrews authored Mar 26, 2024
1 parent 983696b commit 7308249
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions ibis/expr/types/arrays.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,18 +759,7 @@ def unique(self) -> ir.ArrayValue:
--------
>>> import ibis
>>> ibis.options.interactive = True
>>> t = ibis.memtable({"arr": [[1, 3, 3], [], [42, 42], None]})
>>> t
┏━━━━━━━━━━━━━━━━━━━━━━┓
┃ arr ┃
┡━━━━━━━━━━━━━━━━━━━━━━┩
│ array<int64> │
├──────────────────────┤
│ [1, 3, ... +1] │
│ [] │
│ [42, 42] │
│ NULL │
└──────────────────────┘
>>> t = ibis.memtable({"arr": [[1, 3, 3], [], [42, 42, None], None]})
>>> t.arr.unique()
┏━━━━━━━━━━━━━━━━━━━━━━┓
┃ ArrayDistinct(arr) ┃
Expand All @@ -779,7 +768,7 @@ def unique(self) -> ir.ArrayValue:
├──────────────────────┤
│ [3, 1] │
│ [] │
│ [42]
│ [42, None]
│ NULL │
└──────────────────────┘
"""
Expand Down

0 comments on commit 7308249

Please sign in to comment.