Constructors¶
The main strategy arrays().
The function arrays() is the main strategy of this package. It generates Awkward
Arrays with multiple options to control the layout, data types, missing values, masks,
and other array attributes.
Functions:
| Name | Description |
|---|---|
arrays |
Strategy for Awkward Arrays. |
arrays ¶
arrays(
draw: DrawFn,
*,
dtypes: SearchStrategy[dtype] | None = None,
max_size: int = 10,
allow_nan: bool = True,
allow_numpy: bool = True,
allow_empty: bool = True,
allow_string: bool = True,
allow_bytestring: bool = True,
allow_regular: bool = True,
allow_list_offset: bool = True,
allow_list: bool = True,
allow_record: bool = True,
allow_union: bool = True,
max_depth: int = 5,
max_length: int | None = None,
allow_virtual: bool = True,
) -> ak.Array
Strategy for Awkward Arrays.
Builds arrays with NumpyArray, EmptyArray, string, and bytestring as leaf contents that can be nested multiple levels deep in RegularArray, ListOffsetArray, ListArray, RecordArray, and UnionArray. Arrays might be virtual.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dtypes
|
SearchStrategy[dtype] | None
|
A strategy for NumPy scalar dtypes used in |
None
|
max_size
|
int
|
Maximum total number of elements in the generated content. Each numerical value, including complex and datetime, counts as one. Each string and bytestring (not character or byte) counts as one. |
10
|
allow_nan
|
bool
|
No |
True
|
allow_numpy
|
bool
|
No |
True
|
allow_empty
|
bool
|
No |
True
|
allow_string
|
bool
|
No string content is generated if |
True
|
allow_bytestring
|
bool
|
No bytestring content is generated if |
True
|
allow_regular
|
bool
|
No |
True
|
allow_list_offset
|
bool
|
No |
True
|
allow_list
|
bool
|
No |
True
|
allow_record
|
bool
|
No |
True
|
allow_union
|
bool
|
No |
True
|
max_depth
|
int
|
Maximum nesting depth. Each RegularArray, ListOffsetArray, ListArray, RecordArray, and UnionArray layer adds one level, excluding those that form string or bytestring content. |
5
|
max_length
|
int | None
|
Maximum |
None
|
allow_virtual
|
bool
|
No virtual arrays are generated if |
True
|
Examples: