ak.types.from_datashape#
Defined in awkward.types.type on line 312.
- ak.types.from_datashape(datashape, highlevel=True)#
Parses
datashape(str) and returns aak.types.Typeobject, the inverse of callingstron aak.types.Type.If
highlevel=True, and the type string starts with a number (e.g. ‘1000 * …’), the return type isak.types.ArrayType, representing anak.highlevel.Array.If
highlevel=Trueand the type string starts with a record indicator (e.g.{), the return type isak.types.ScalarTypewith anak.types.RecordTypecontent, representing a scalarak.highlevel.Recordrather than an array of them.Other strings (e.g. starting with
var *,?,option, etc.) are not compatible withhighlevel=True; an exception would be raised.If
highlevel=False, the type is assumed to represent a layout (e.g. a number indicates aak.types.RegularType, rather than aak.types.ArrayType).