Message Boards Message Boards

How to convert Mathematica notebook to Jupyter notebooks and vice versa?

Posted 1 year ago

Hi,
Is there a way to convert Mathematica notebooks to jupyter notebooks and vice versa? If you are writing lecture notes using jupyter notebooks is a better option. However, in doing calculations Mathematica notebook is superior. If there is a simple conversion between two of them it would be very useful.

POSTED BY: virtual mind
10 Replies

No. At least not in an easy way. The Mathematica notebook is much more advanced.

POSTED BY: Sander Huisman

Curious why you think Jupyter is a better option for writing lecture notes.

POSTED BY: Rohit Namjoshi
Posted 1 year ago

Markdown language is easy to use for writing notes. Even though mathematical notebooks offer lots of features in the format of the text I guess it is behind the simplicity of the markdown language. Besides, more importantly, not everyone in our group has a license for Mathematica. Hence some of us are using the wolfram kernel via jupyter notebooks. It would be better if the conversion was possible.

POSTED BY: virtual mind
Posted 1 year ago

I'm going to second this question....I have some old Mathematica notebooks that I want to revisit using Jupyter Notebooks + Wolframe Engine. It would be helpful if I didn't have to rewrite the Mathematica notebooks.

POSTED BY: Troy H

Easy!

  1. Download the Jupyter notebook as Markdown file.
    • Alternatively, use jupytext to convert ".ipynb" files into ".md" files.
  2. Use the Markdown-to-Mathematica converter.
POSTED BY: Anton Antonov
Posted 1 year ago

Anton- Thanks for the reply!

What about the other way around? Mathematica to Jupyter?

I'll go one step further and ask if you can do the conversion without Mathematica?

I have a bunch of old Mathematica notebooks that I'm now trying to use in Jupyter + Wolfram Engine. I no longer have Mathematica, so I can use the notebook tools.

POSTED BY: Troy H

Easy!

  1. Convert Mathematica notebook to Markdown file using M2MD.

    • Needs Mathematica.
  2. Convert Markdown file to Jupyter notebook using jupytext.


I have requested recently to be able to run M2MD without Mathematica -- see the issues of that GitHub repository. (I.e. using WolframEngine and/or wolframscript.)

POSTED BY: Anton Antonov
Posted 1 year ago

And if I don't have Mathematica?

POSTED BY: Troy H

Unfortunately, this is not possible, you have to learn Mathematics because it is better in my opinion. Besides that for my writings I use https://sunnypapers.com/paper-samples/lord-of-the-flies/ because there are funny topics like Lord of the flies here)) This amuses me, especially because from here you can get a lot of information that will look pretty good for my project.

POSTED BY: Pablo Santiago
Posted 1 year ago

This should be a feature since it is what the ML community uses!

Converting a WL notebook to a Jupyter notebook and running the Jupyter server (with the free developer Wolfram Engine kernel) is currently the only way to truly share the WL notebook with people in the ML community without making them signup and learn Mathematica.

Please petition WRI to add export and import from WL <-> Jupyter notebooks.

POSTED BY: Ethan Black
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract