Builtins¶
Strategies for built-in Python objects in the context of Awkward Array.
These strategies are related to the section of Awkward Array User Guide "How to convert to/from Python objects".
Functions:
| Name | Description |
|---|---|
builtin_safe_dtypes |
Strategy for NumPy dtypes with corresponding Python built-in types. |
items_from_dtype |
Strategy for Python built-in type values for a given NumPy dtype. |
from_list |
Strategy for Awkward Arrays created from Python lists. |
lists |
Strategy for nested Python lists for which Awkward Arrays can be created. |
builtin_safe_dtypes ¶
items_from_dtype ¶
Strategy for Python built-in type values for a given NumPy dtype.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dtype
|
dtype
|
The NumPy dtype to generate items for. |
required |
allow_nan
|
bool
|
Generate potentially |
False
|
Examples:
from_list ¶
from_list(
*,
dtype: dtype | SearchStrategy[dtype] | None = None,
allow_nan: bool = False,
max_size: int = 10,
) -> st.SearchStrategy[ak.Array]
Strategy for Awkward Arrays created from Python lists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dtype
|
dtype | SearchStrategy[dtype] | None
|
The dtype of the list items or a strategy to generate it. If |
None
|
allow_nan
|
bool
|
Generate potentially |
False
|
max_size
|
int
|
Maximum total number of items (non-lists) in the entire nested list. |
10
|
Examples:
lists ¶
lists(
draw: DrawFn,
*,
dtype: dtype | SearchStrategy[dtype] | None = None,
allow_nan: bool = False,
max_size: int = 10,
) -> NestedList
Strategy for nested Python lists for which Awkward Arrays can be created.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dtype
|
dtype | SearchStrategy[dtype] | None
|
The dtype of the list items or a strategy to generate it. If |
None
|
allow_nan
|
bool
|
Generate potentially |
False
|
max_size
|
int
|
Maximum total number of items (non-lists) in the entire nested list. |
10
|
Examples: