To Jupyter - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Worksheet

  

WorksheetToJupyter

  

convert a worksheet into a Jupyter notebook

 

Calling Sequence

Parameters

Options

Description

Notes

Examples

Compatibility

Calling Sequence

WorksheetToJupyter( worksheet, opts )

Parameters

worksheet

-

string or XML tree data structure

opts

-

(optional) options of the form outputfile = ~path

Options

• 

outputfile = string

  

Specifies a file path to which to write the generated Jupyter notebook. If omitted, no file is generated and a string encoding the generated notebook is returned.

Description

• 

WorksheetToJupyter(worksheet) converts a Maple worksheet in .mw format into a Jupyter notebook containing the equivalent input commands suitable for use with the Maple Kernel for Jupyter.

• 

If the first argument worksheet is a string, it is treated as a filename. Otherwise, a worksheet as an XML tree data structure is expected.

• 

If an output file is specified with option outputfile, the notebook is written to outputfile and the number of bytes written to the file is returned. Otherwise the output is a string which encodes the generated notebook.

Notes

• 

This command only fully supports worksheets.  It may not work properly for Maple documents with tables or components.

• 

Output saved in the original worksheet is not translated to output in the Jupyter workbook. To see output in the Jupyter notebook, execute the notebook using the Maple Kernel for Jupyter.

Examples

withWorksheet:

filenameFileTools:-JoinPathexample,MatrixExample.mw,base=datadir

filename/maple/cbat/active/268316/data/example/MatrixExample.mw

(1)

WorksheetToJupyterfilename

{ "nbformat_minor": 4, "nbformat": 4, "metadata": { "language_info": { "name": "maple", "file_extension": ".mpl", "mimetype": "application/vnd.maple.mpl", "version": "2024" }, "kernelspec": { "display_name": "Maple 2024", "language": "maple", "name": "maple" } }, "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { }, "outputs": [ ], "source": [ "m := Matrix(2,2,[[-4, sqrt(17)], [ln(45), 61/4]])" ] }, { "cell_type": "code", "execution_count": null, "metadata": { }, "outputs": [ ], "source": [ "m[1,1]*m[2,2]-m[1,2]*m[2,1]" ] } ] }

(2)

Esqrtxπ

Exπ

(3)

useDocumentTools,DocumentTools:-LayoutinWWorksheetGroupInputTextfieldEquationE,executable=true,style=TwoDimInput,style=MapleInputend use

WorksheetToJupyterW

{ "nbformat_minor": 4, "nbformat": 4, "metadata": { "language_info": { "name": "maple", "file_extension": ".mpl", "mimetype": "application/vnd.maple.mpl", "version": "2024" }, "kernelspec": { "display_name": "Maple 2024", "language": "maple", "name": "maple" } }, "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { }, "outputs": [ ], "source": [ "sqrt(x)/Pi" ] } ] }

(4)

Compatibility

• 

The Worksheet:-WorksheetToJupyter command was introduced in Maple 2022.

• 

For more information on Maple 2022 changes, see Updates in Maple 2022.

See Also

Export as Maple Text

Jupyter/package

Maple Kernel for Jupyter

Worksheet

XMLTools