ak.types.from_datashape#

Defined in awkward.types.type on line 308.

ak.types.from_datashape(datashape, highlevel=True)#

Parses datashape (str) and returns a ak.types.Type object, the inverse of calling str on a ak.types.Type.

If highlevel=True, and the type string starts with a number (e.g. ‘1000 * …’), the return type is ak.types.ArrayType, representing an ak.highlevel.Array.

If highlevel=True and the type string starts with a record indicator (e.g. {), the return type is ak.types.ScalarType with an ak.types.RecordType content, representing a scalar ak.highlevel.Record rather than an array of them.

Other strings (e.g. starting with var *, ?, option, etc.) are not compatible with highlevel=True; an exception would be raised.

If highlevel=False, the type is assumed to represent a layout (e.g. a number indicates a ak.types.RegularType, rather than a ak.types.ArrayType).