Data Import and Export - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : System : Information : Updates : Maple 2020 : Data Import and Export

Data Import and Export

Maple 2020 includes these updates to data import and export.

 

Read Part of an Audio File

FileTools:-Walk

Import and Export of BSON and UBJSON Files

Read Part of an Audio File

The AudioTools:-Read command has a new samples option which enables reading part of an audio file.
Here the interval  is specified, which indicates that only samples 1000 to 60000 will be read from the specified file.

(1.1)

FileTools:-Walk

The new FileTools:-Walk command generates an iterator to traverse subdirectories under a given directory.

(2.1)

(2.2)

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.

(3.1)

(3.2)

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):

(3.3)

 

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.

(3.4)

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:

(3.5)

(3.6)

(3.7)

These inputs are suitable as input to Python:-EvalFunction, provided the underlying Python data types match:

(3.8)

We can also convert certain Python expressions into Maple expressions:

(3.9)

(3.10)

(3.11)


Download Help Document