Maple 2020 includes these updates to data import and export.
The AudioTools:-Read command has a new samples option which enables reading part of an audio file.
Here the interval 10^3 .. 60*10^3; is specified, which indicates that only samples 1000 to 60000 will be read from the specified file.
FileTools:-Walk
The new FileTools:-Walk command generates an iterator to traverse subdirectories under a given directory.
Import and Export of BSON and UBJSON Files
The Import and Export commands now support and import and export of BSON and UBJSON files. These are both binary file formats modeled after the JSON format. They store structured expressions in a manner similar to JSON.
The BSON format can store additional types of data, including byte arrays and date/time objects. The latter are translated to Maple Time objects upon import.
`, "event" = "United Nations Declaration of Human Rights", "location" = TABLE(["city" = "Paris"..." align="center" border="0"> `, "event" = "United Nations Declaration of Human Rights", "location" = TABLE(["city" = "Paris"..." align="center" border="0"> `, "event" = "United Nations Declaration of Human Rights", "location" = TABLE(["city" = "Paris"..." align="center" border="0"> |
ImportMatrix
The ImportMatrix command has been updated with two new options: direct and fill.
The direct option enables parsing data from strings and ByteArrays (in addition to files and URLs):
The fill option specifies a default value for missing data when the input is ragged; a ragged input is an input in which some rows have fewer entries than others.
In the following example, the first row has four entries while the second and third are underspecified, in which case the fill value of 999 is used.
Data conversions to and from Python
The convert command now allows explicit conversion of certain Maple expressions to their Python counterparts and vice-versa.
In the following example we convert three expressions to Python expressions:
"], [" |
"], [" |
"], [" |
These inputs are suitable as input to Python:-EvalFunction, provided the underlying Python data types match:
"], [" |
We can also convert certain Python expressions into Maple expressions: