39 votes
Accepted

Exchanging numpy arrays between Python and Mathematica?

You can use the binary format to speed up the process: python side import numpy as np array = np.random.rand(100000000); array.astype('float32').tofile('np.dat') ...
xslittlegrass's user avatar
37 votes
Accepted

Running Mathematica on Docker

Updated answer with Dockerfile After the release of wolfram engine I thought it is a good time to revisit this old answer and refine it a bit. First install docker on your machine. Follow docker ...
PlatoManiac's user avatar
  • 14.7k
35 votes

How can I use the Python library networkx from Mathematica?

Mathematica 12.0 brings two new features that make this easier to do than it was before: ExternalFunction Wolfram Client for Python Below we implement a function <...
Szabolcs's user avatar
  • 234k
30 votes
Accepted

3D rigid body physics engine

Since this answer was originally posted, the Blender software package has undergone significant revision causing the Python scripts to break. I have modified the scripts so that they should work from ...
Tim Laska's user avatar
  • 16.3k
18 votes

Minimal effort method for integrating C++ functions into Mathematica

In terms of loading C++ functions, I would strongly suggest LibraryLink. It is a great tool except that it requires you to write sometimes intimidating C code. To make LibraryLink easier to use, I ...
njpipeorgan's user avatar
  • 1,166
16 votes

Exchanging numpy arrays between Python and Mathematica?

Here is a template to read a numpy binary ".npy" file created simply by numpy.save(filename,array) this file format has the array structure encoded as a python ...
george2079's user avatar
  • 38.9k
15 votes
Accepted

Is there a way to run Python from within Mathematica?

Since 11.2 Mathematica has supported ExternalEvaluate and since 11.3 this functionality has been conveniently available simply by beginning an input cell with ...
orome's user avatar
  • 12.8k
14 votes

Export a 3D array from Mathematica and import it in python as a numpy array

.fits method One possible way is to use the .fits format... Export["~/Dropbox/tensor.fits", tensor] ...
conor's user avatar
  • 7,369
14 votes
Accepted

WXF encoder library for C++

We have developed a C library to support BinarySerialize/BinaryDeserialize. I confirm that we plan to open-source it as well. ...
Dorian B.'s user avatar
  • 381
14 votes
Accepted

Reusing PARDISO symbolic factorization

No, this is not built-in and I have been waiting quite long for such a feature. PardisoLink With the help of Szabolcs's package "LTemplate`" I had written such an interface for the Intel MKL ...
Henrik Schumacher's user avatar
12 votes

Step-by-step instruction to Install C Compiler

Even though it's quite late to reply, but I need to point out that the culprit is the white space between Program Files. If you set the installing path without ...
luyuwuli's user avatar
  • 2,804
12 votes

Call a Haskell DLL from Mathematica

The problem lies in the declaration of the DLL function acumSumR. It is declared to return a double[] but the Haskell return ...
WReach's user avatar
  • 68.6k
11 votes

How can I get OSX split screen to work?

Update: Mathematica 12.0 now supports this. You can't. This feature only works with certain programs and as of version 10.4 Mathematica is not one of them. Maybe the coming Mac front end ...
Szabolcs's user avatar
  • 234k
11 votes

Running Mathematica on Docker

I created public resources to simplify and automate PlatoManiac's answer for you and all of us: TLDR https://account.wolfram.com/access/wolfram-engine/free?operatingSystem=LINUX ...
Wolframlanguage Fan's user avatar
11 votes
Accepted

Corresponding built-in types for Python

I think you can find what you're looking for here:
ktm's user avatar
  • 4,232
10 votes
Accepted

What is the correct path to add a camera driver?

After 2 years of research and posting this question in other sites, the answer is that although Mathematica (Windows) detects the Camera device, only imaging devices using the Windows video image ...
Jose Enrique Calderon's user avatar
10 votes

Call julia from Mathematica?

Turn the comment into an answer. The functionality is available (as EXPERIMENTAL) in v12.1. One can refer to the following pages in the document: "Julia" (External Evaluation System) ...
10 votes

Getting data into Julia session?

Fortunately, the Wolfram team had done the hard part for us. We don't have to build interface to call julia (in most cases). First, start a session: ...
Ben Izd's user avatar
  • 9,169
9 votes

Write C/C++ programs calling Mathematica functions

The other answers ignore that you are asking about C or C++ (not C# or Java!) Mathematica can be called from C (or C++) through the MathLink interface (recently renamed to WSTP). To learn it, I ...
Szabolcs's user avatar
  • 234k
9 votes
Accepted

Make Mathematica input things on a website and take the data out

ConfigureNodeJSForExternalEvaluate ...
Kuba's user avatar
  • 137k
8 votes
Accepted

What´s the best way to COPY/PASTE Mathematica code into Word?

In your code notebook go to menu Format, Edit StyleSheet paste in the following ...
Chris Degnen's user avatar
  • 30.8k
8 votes
Accepted

How to copy formatted numbers as MathML without quotation marks?

Original answer The reason for getting extra quotes is that these extra quotes are explicitly present in the box form of the expression generated by such functions as ...
Alexey Popkov's user avatar
8 votes

Syntax Highlighting for WL files in Atom/Sublime?

I use language-mathematica with Atom, it includes function name autocompletion up to 11.0.1 as well as links to the WL reference. There's also goto-mathematica by the same author as well as a plugin ...
Graumagier's user avatar
  • 1,130
8 votes
Accepted

Using local variables in ExternalEvaluate Python

You may use the Association syntax for ExternalEvaluate. If numpy is installed in your ...
Edmund's user avatar
  • 42k
7 votes

How to use Mathematica functions in Python programs?

As yet another solution, you can use a new package called PJLink which implements JLink for python. Once you have the package installed you start a KernelLink ...
b3m2a1's user avatar
  • 46.8k
7 votes

Write C/C++ programs calling Mathematica functions

C Style To Call Mathematica functions from C/C++ you need to use ML_ or WS_ functions. ...
Neel Basu's user avatar
  • 961
7 votes
Accepted

Reading data from Google Docs

This seems to work: ...
chuy's user avatar
  • 11.2k
7 votes

Web Browsing Automation: how to expand all comments under a blog post?

Here is one way to do it, using WebUnit: Needs["WebUnit`"]; InstallWebUnit[]; StartWebSession[]; OpenWebPage["http://suggestions.livejournal.com/825341.html"]; ...
Arnoud Buzing's user avatar
7 votes

Using ImageJ filters directly from Mathematica through J/Link

This is not an answer to the main question on how to do it in Mathematica but merely one possible reason why this whole thing might not be achievable. In Java, your exact example looks like this <...
halirutan's user avatar
  • 113k
7 votes

Using local variables in ExternalEvaluate Python

If you are willing to setup and use WolframClientForPython you could do: With Mathematica ...
b.gates.you.know.what's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible