Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions arkouda/client_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,30 @@
- `IPv4`: For storing and displaying 32-bit integers as IPv4 addresses.

These classes enhance usability and improve readability when working with encoded or
domain-specific data while preserving Arkouda’s performance model and distributed data structures.
domain-specific data while preserving Arkouda's performance model and distributed data
structures.

Functions
---------
- `bit_vectorizer`: Creates a partially applied BitVector constructor.
- `ip_address`: Converts various formats to an Arkouda IPv4 object.
- `is_ipv4`: Returns a boolean array indicating IPv4 addresses.
- `is_ipv6`: Returns a boolean array indicating IPv6 addresses.
bit_vectorizer
Creates a partially applied BitVector constructor.

ip_address
Converts various formats to an Arkouda IPv4 object.

is_ipv4
Returns a boolean array indicating IPv4 addresses.

is_ipv6
Returns a boolean array indicating IPv6 addresses.

Examples
--------
>>> import arkouda as ak
>>> from arkouda.client_dtypes import BitVector, Fields, IPv4, ip_address, is_ipv4

Create and use BitVectors:

>>> a = ak.array([3, 5, 7])
>>> bv = BitVector(a, width=4)
>>> print(bv)
Expand All @@ -33,11 +42,13 @@
width=4, reverse=False)

Create Fields with named binary flags:

>>> f = Fields(ak.array([1, 2, 3]), names=['read', 'write', 'exec'], separator=':')
>>> print(f[0]) # doctest: +SKIP
--:--:read (1)

Convert and work with IP addresses:

>>> ips = ip_address(['192.168.0.1', '10.0.0.1'])
>>> print(ips)
IPv4([192.168.0.1,
Expand All @@ -46,7 +57,6 @@

>>> is_ipv4(ips)
array([True True])

"""

from functools import partial
Expand Down