Skip to main content

Questions tagged [python]

Questions about interfacing with, or features inspired or demonstrated by Python--a programming language featuring a dynamic type system, automatic memory management, and a comprehensive standard library.

Filter by
Sorted by
Tagged with
10 votes
1 answer
378 views

I am working on a Mathematica package for knot theory that combines functionality of several other packages. Two notable examples are SnapPy and Regina. Fortunately, both have a rich Python interface ...
Henrik Schumacher's user avatar
7 votes
3 answers
467 views

In Python there are very easy to use and efficient libraries for surface parametrization (for instance igl). I wonder if in Mathematica we have a ready-made implementation. The parametrization is ...
Daniel Castro's user avatar
0 votes
0 answers
72 views

I have two mathematically equivalent latex strings ...
Kevin Powell's user avatar
0 votes
0 answers
87 views

I am trying to register an external installation of Python 3.13 to be usable through ExternalEvaluate in Mathematica v14. After running FindExternalEvaluators["Python"], I can see the ...
user107868's user avatar
5 votes
0 answers
165 views

There is a book on dynamic programming. There is an introduciton chapter on simple cake-eating problem. The model is $$\max_{\{c_t\}} \sum_{t=0}^\infty \beta^t u(c_t) \quad \text{s.t.} \quad x_{t+1} = ...
garej's user avatar
  • 5,017
2 votes
0 answers
46 views

session = StartExternalSession["Python"] starts a python session on the local machine. ...
StackExchanger's user avatar
2 votes
0 answers
76 views

How can I call a function made with Compile in Python, Is it possible to just save it using LibraryGenerateand call the ...
Felipe's user avatar
  • 729
1 vote
1 answer
153 views

I have the following snippet written in Python that I want to run in Mathematica ...
QFTheorist's user avatar
4 votes
1 answer
243 views

I have worked out a (regrettably rather laborious and seemingly irreducible) expression in Mathematica. I'd like to use this expression in a ...
IntegerEuler's user avatar
2 votes
0 answers
486 views

I have very large expressions in Mathematica which I need to convert to python for fast numerical computations. Is there a way to do it automatically. I dont want to type it manually. It will take me ...
Lelouch's user avatar
  • 151
0 votes
0 answers
45 views

Consider the following data: ...
John Taylor's user avatar
  • 6,063
7 votes
2 answers
625 views

I want to do something like this: ...
Haoen Zhang's user avatar
3 votes
1 answer
172 views

I'm trying to simulate with python and Mathematica, Python need to generate and save some pictures to the directory of current mma notebook, I know the function that ...
Yao Li's user avatar
  • 111
0 votes
1 answer
237 views

I have an enormous algebraic expression in Mathematica that I want to export to Python. The expression per se is not complicated, more like a polynomial, but it contains some special functions defined ...
SNC92's user avatar
  • 63
3 votes
0 answers
75 views

I have a CompiledFunction e.g. this: ...
Okarin's user avatar
  • 31
1 vote
1 answer
80 views

Iterators are a common pattern in python. A trivial example is: example = iter(("apple", "banana", "cherry")) next(example) (yes, of ...
Joshua Schrier's user avatar
0 votes
0 answers
109 views

I often hear, in the physics community, that python is faster and overall better than mathematica for numeric calculations. But this seems very subjective since code badly written in one language can ...
Felipe's user avatar
  • 729
0 votes
1 answer
90 views

We can see all registered Python environments through FindExternalEvaluators["Python"]. But the user interface will use the last registered one. How to ...
Alexey Golyshev's user avatar
1 vote
1 answer
150 views

Question While working with Python's ExternalEvaluate the intermediate calculation results with Python are stored in the notebook. (...
Anton Antonov's user avatar
2 votes
1 answer
249 views

I am trying to convert this Python code for Classical map of kicked top to Mathematica. For a single trajectory, I am able to ...
user444's user avatar
  • 2,836
1 vote
0 answers
226 views

While there are many ways to convert a Mathematica expression into other Languages, I was wondering if there is something reverse for Python. There are some discussions in Python groups, but I am ...
BabaYaga's user avatar
  • 1,957
1 vote
1 answer
341 views

I am trying to compare the performance of Mathematica vs Python for vectorized operations involving polynomials. The data is floatMatrix which has dimensions (...
mmen's user avatar
  • 163
1 vote
0 answers
71 views

Can you confirm this bug when evaluating Python code in Mathmatica? Type > select Python by clicking on the icon on the left then paste the following code and ...
azerbajdzan's user avatar
  • 32.8k
0 votes
0 answers
151 views

I am using the latest version 13.3, does Wolfram comes preinstalled with a python kernel/distribution? I heard that some of the currently working features like sqlite connectivity uses python code, so ...
user13892's user avatar
  • 10.4k
0 votes
0 answers
298 views

I have been using the Mathematica client library for Python, but it errors at random some times when running the program, returning: wolframclient.exception.WolframKernelException: Failed to ...
Vibbbb's user avatar
  • 1
3 votes
1 answer
266 views

Consider the following plot, obtained with the Python plotting library matplotlib: Is it possible to get the plot ticks to have this same style in a Mathematica ...
sam wolfe's user avatar
  • 5,023
0 votes
0 answers
151 views

I have a Mathematica code that I want to run via Python using subprocess. The Mathematica code contains two variables that I want to pass through Python. However, when I tried to do that, I always got ...
j.doe's user avatar
  • 123
11 votes
0 answers
382 views

Edit 3: This bug is no longer present in Version 14.1. It appears to have been fixed in either Version 14.0 or Version 14.1. Edit 1: A support case with the identification [CASE:5059026] was created. ...
Shredderroy's user avatar
  • 5,431
6 votes
1 answer
2k views

The quasi-one-dimensional model describing the flow of compressible gas in rocket nozzles is very common. The corresponding equations have a divergent non dimensional form $ \frac{\partial \mathbf{U}}...
Alex Trounev's user avatar
  • 52.2k
8 votes
3 answers
1k views

I would like to pass Mathematica variable values to Python. But I found that it was not that trivial. For example, a typical way would be: ...
Satoshi Oota's user avatar
4 votes
0 answers
228 views

Using Mathematica, I trained and exported some machine learning models with the suggested file extension .wmlf. However, I noticed that these files are stored in HDF5 format. How can I import these ...
Jeremy L's user avatar
5 votes
2 answers
586 views

I recently learned that python's numpy package contains a function called fftfreq (documented at numpy.fft.fftfreq) which is ...
Emilio Pisanty's user avatar
2 votes
0 answers
212 views

Is there any way for python to generate a list and then find a function based on it just like how FindFit works in Wolfram? Preferably I would like the solution to work on Replit or Google Colab. ...
ABRAMOVICH OZ's user avatar
1 vote
0 answers
214 views

I want to use specific python libraries via the Mathematica frontend. This is possible as follows ...
Asim's user avatar
  • 1,150
3 votes
0 answers
248 views

Summary: I would like to use the Wolfram Client Library for Python to invoke Mathematica's Minimize function directly from within Python, passing to it Python data structures. Details: I have a Python ...
Neil Fazel's user avatar
1 vote
0 answers
43 views

Very quick and dirty question. I'm trying to write a program written in python into mathematica and there is a section that uses the gradient function in the numpty python library, ...
Koji's user avatar
  • 61
1 vote
0 answers
89 views

You can type > at the beginning of a cell (or right click and choose "insert new cell" - "ExternalLanguage") and then you can choose the ...
azerbajdzan's user avatar
  • 32.8k
6 votes
1 answer
271 views

I am trying to use the Mathematica output of a complicated expression as input for python. As suggested in this answer, the FortranForm of an expression already ...
sqrt6's user avatar
  • 63
3 votes
2 answers
491 views

So! I have what seems like a rather basic hyperbolic equation to be solved written in Mathematica, with an integer input ‘n’, for which I am seeking the First {x,y} Integer solution to satisfy the ...
Travis Arlen McCracken's user avatar
3 votes
1 answer
657 views

How to run the Wolfram language using Wolfram Client Library for Python in Google colab?
Mainul Islam's user avatar
3 votes
2 answers
693 views

I have a python code for data analysis, that uses the "seismic" color scale for 2D density plots. However, I also need to do some other plots with Mathematica (because of packages etc), for ...
m137's user avatar
  • 357
2 votes
0 answers
147 views

How can we use the wolframclient Python library to call Mathematica functions when Mathematica is running in an another server? For example, if we have Mathematica ...
GarouDan's user avatar
  • 1,536
0 votes
0 answers
378 views

I would like to use the NSolve function from Mathematica in a Python code to solve a polynomial system of equations. So my question is, whether there is an option to call this kind of function in a ...
Nils's user avatar
  • 1
4 votes
1 answer
266 views

I encountered the following issue with WolframClient. I have a my.function file which contains some function that takes some ...
Morgan's user avatar
  • 595
10 votes
1 answer
844 views

I want to plot things with Mathematica, inside an ipynb Python notebook. I can easily plot functions that are expressed in the Wolfram Language, e.g. with ...
JEM_Mosig's user avatar
  • 3,053
0 votes
0 answers
134 views

In the above screenshot, I've shared the installed and registered version of python. However, when I try to use it, it ends up with an error. ...
user444's user avatar
  • 2,836
1 vote
2 answers
896 views

In python,I run fft as below: ...
kittygirl's user avatar
  • 707
7 votes
2 answers
527 views

I am attempting to use ExternalEvaluate to use some python packages (ARC) to save me some effort in performing the calculations in Mathematica, and for the most part I think it works as intended. The ...
D. Brown's user avatar
  • 324
2 votes
1 answer
318 views

I really like the idea of the Wolfram Engine, and in particular using it via the python client library. However, I've having trouble understanding the syntax for even simple commands: is there some ...
AnotherShruggingPhysicist's user avatar

1
2 3 4 5 6