ak.forms.Form#

Defined in awkward.forms.form on line 385.

class ak.forms.Form#
_init(*, parameters: awkward._typing.JSONMapping | None, form_key: str | None)#
property form_key#
to_dict(verbose=True)#
_to_dict_extra(out, verbose)#
to_json()#
_repr_args()#
abstract property type#
columns(list_indicator=None, column_prefix=())#
select_columns(specifier, expand_braces=True, *, prune_unions_and_records: bool = True)#

select_columns returns a new Form with only columns and sub-columns selected. Returns an empty Form if no columns matched the specifier(s).

specifier can be a str | Iterable[str | Iterable[str]]. Strings may include shell-globbing-style wildcards “*” and “?”. If expand_braces is True (the default), strings may include alternatives in braces. For example, [“a.{b,c}.d”] is equivalent to [“a.b.d”, “a.c.d”]. Glob-style matching would also suit this single-character instance: “a.[bc].d”. If specifier is a list which contains a list/tuple, that inner list will be interpreted as column and subcolumn specifiers. They may contain wildcards, but “.” will not be interpreted as a <field>.<subfield> pattern.

column_types()#
abstract _columns(path, output, list_indicator)#
abstract _prune_columns(is_inside_record_or_union: bool) Form | None#
abstract _select_columns(match_specifier: _SpecifierMatcher) Form | None#
abstract _column_types()#
abstract _to_dict_part(verbose, toplevel)#
length_zero_array(*, backend=numpy_backend, highlevel=False, behavior=None)#
length_one_array(*, backend=numpy_backend, highlevel=False, behavior=None)#
abstract _expected_from_buffers(getkey: collections.abc.Callable[[Form, str], str], recursive: bool) awkward._typing.Iterator[tuple[str, awkward._typing.DType]]#
expected_from_buffers(buffer_key='{form_key}-{attribute}', recursive=True)#
Parameters:
  • buffer_key (str or callable) – Python format string containing “{form_key}” and/or “{attribute}” or a function that takes these as keyword arguments and returns a string to use as a key for a buffer in the container.

  • recursive (bool) – If True, recurse into subforms; otherwise, yield only the (buffer_key, dtype) pairs for this form object.

Yield (buffer_key, dtype) pairs describing the expected buffer keys, and their corresponding dtypes, that a call to #ak.from_buffers would be expected to find from the container object.

is_equal_to(other: awkward._typing.Any, *, all_parameters: bool = False, form_key: bool = False) bool#
abstract _is_equal_to(other: awkward._typing.Any, all_parameters: bool, form_key: bool) bool#
_is_equal_to_generic(other: awkward._typing.Any, all_parameters: bool, form_key: bool) bool#