arkouda.client_dtypes¶
Classes¶
Functions¶
|
Make a callback (i.e. function) that can be called on an |
|
Convert values to an Arkouda array of IP addresses. |
|
Indicate which values are ipv4 when passed data containing IPv4 and IPv6 values. |
|
Indicate which values are ipv6 when passed data containing IPv4 and IPv6 values. |
Module Contents¶
- class arkouda.client_dtypes.BitVector(values, width=64, reverse=False)[source]¶
Bases:
arkouda.pdarrayclass.pdarray
Represent integers as bit vectors, e.g. a set of flags.
- Parameters:
- Returns:
bitvectors – The array of binary vectors
- Return type:
Notes
This class is a thin wrapper around pdarray that mostly affects how values are displayed to the user. Operators and methods will typically treat this class like a uint64 pdarray.
- conserves¶
- register(user_defined_name)[source]¶
Register this BitVector object and underlying components with the Arkouda server
- Parameters:
user_defined_name (str) – user defined name the BitVector is to be registered under, this will be the root name for underlying components
- Returns:
The same BitVector which is now registered with the arkouda server and has an updated name. This is an in-place modification, the original is returned to support a fluid programming style. Please note you cannot register two different BitVectors with the same name.
- Return type:
- Raises:
TypeError – Raised if user_defined_name is not a str
RegistrationError – If the server was unable to register the BitVector with the user_defined_name
See also
unregister
,attach
,is_registered
Notes
Objects registered with the server are immune to deletion until they are unregistered.
- registered_name = None¶
- reverse¶
- special_objType = 'BitVector'¶
- values¶
- width¶
- arkouda.client_dtypes.BitVectorizer(width=64, reverse=False)[source]¶
Make a callback (i.e. function) that can be called on an array to create a BitVector.
- Parameters:
width (int) – The number of bit fields in the vector
reverse (bool) – If True, display bits from least significant (left) to most significant (right). By default, the most significant bit is the left-most bit.
- Returns:
bitvectorizer – A function that takes an array and returns a BitVector instance
- Return type:
callable
- class arkouda.client_dtypes.Fields(values, names, MSB_left=True, pad='-', separator='', show_int=True)[source]¶
Bases:
BitVector
An integer-backed representation of a set of named binary fields, e.g. flags.
- Parameters:
values (pdarray or Strings) – The array of field values. If (u)int64, the values are used as-is for the binary representation of fields. If Strings, the values are converted to binary according to the mapping defined by the names and MSB_left arguments.
names (str or sequence of str) – The names of the fields, in order. A string will be treated as a list of single-character field names. Multi-character field names are allowed, but must be passed as a list or tuple and user must specify a separator.
MSB_left (bool) – Controls how field names are mapped to binary values. If True (default), the left-most field name corresponds to the most significant bit in the binary representation. If False, the left-most field name corresponds to the least significant bit.
pad (str) – Character to display when field is not present. Use empty string if no padding is desired.
separator (str) – Substring that separates fields. Used to parse input values (if ak.Strings) and to display output.
show_int (bool) – If True (default), display the integer value of the binary fields in output.
- Returns:
fields – The array of field values
- Return type:
Notes
This class is a thin wrapper around pdarray that mostly affects how values are displayed to the user. Operators and methods will typically treat this class like an int64 pdarray.
- MSB_left¶
- name = None¶
- names¶
- namewidth¶
- pad¶
- padchar¶
- separator¶
- show_int¶
- class arkouda.client_dtypes.IPv4(values)[source]¶
Bases:
arkouda.pdarrayclass.pdarray
Represent integers as IPv4 addresses.
- Parameters:
- Returns:
The same IP addresses
- Return type:
Notes
This class is a thin wrapper around pdarray that mostly affects how values are displayed to the user. Operators and methods will typically treat this class like an int64 pdarray.
- normalize(x)[source]¶
Take in an IP address as a string, integer, or IPAddress object, and convert it to an integer.
- register(user_defined_name)[source]¶
Register this IPv4 object and underlying components with the Arkouda server
- Parameters:
user_defined_name (str) – user defined name the IPv4 is to be registered under, this will be the root name for underlying components
- Returns:
The same IPv4 which is now registered with the arkouda server and has an updated name. This is an in-place modification, the original is returned to support a fluid programming style. Please note you cannot register two different IPv4s with the same name.
- Return type:
- Raises:
TypeError – Raised if user_defined_name is not a str
RegistrationError – If the server was unable to register the IPv4 with the user_defined_name
See also
unregister
,attach
,is_registered
Notes
Objects registered with the server are immune to deletion until they are unregistered.
- special_objType = 'IPv4'¶
- to_hdf(prefix_path: str, dataset: str = 'array', mode: str = 'truncate', file_type: str = 'distribute')[source]¶
Override of the pdarray to_hdf to store the special object type
- update_hdf(prefix_path: str, dataset: str = 'array', repack: bool = True)[source]¶
Override the pdarray implementation so that the special object type will be used.
- values¶
- arkouda.client_dtypes.ip_address(values)[source]¶
Convert values to an Arkouda array of IP addresses.
- Parameters:
values (list-like, integer pdarray, or IPv4) – The integer IP addresses or IPv4 object.
- Returns:
The same IP addresses as an Arkouda array
- Return type:
Notes
This helper is intended to help future proof changes made to accomodate IPv6 and to prevent errors if a user inadvertently casts a IPv4 instead of a int64 pdarray. It can also be used for importing Python lists of IP addresses into Arkouda.
- arkouda.client_dtypes.is_ipv4(ip: arkouda.pdarrayclass.pdarray | IPv4, ip2: arkouda.pdarrayclass.pdarray | None = None) arkouda.pdarrayclass.pdarray [source]¶
Indicate which values are ipv4 when passed data containing IPv4 and IPv6 values.
- Parameters:
- Return type:
pdarray of bools indicating which indexes are IPv4.
See also
ak.is_ipv6
- arkouda.client_dtypes.is_ipv6(ip: arkouda.pdarrayclass.pdarray | IPv4, ip2: arkouda.pdarrayclass.pdarray | None = None) arkouda.pdarrayclass.pdarray [source]¶
Indicate which values are ipv6 when passed data containing IPv4 and IPv6 values.
- Parameters:
- Return type:
pdarray of bools indicating which indexes are IPv6.
See also
ak.is_ipv4