Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Simplify launching of a new Python session
ResourceFunction["StartPythonSession"][dependencies] starts a new Python session, given a list of dependencies. |
Start a new Python session that includes the "scipy" package:
In[1]:= |
Out[1]= |
Import the package in the session:
In[2]:= |
Load an external function, here the Python version of a fast fourier transform:
In[3]:= |
Out[3]= |
Generate some random real numbers:
In[4]:= |
Out[4]= |
Compute the FFT via Python:
In[5]:= |
Out[5]= |
Compute the equivalent FFT with Fourier. Note that the option FourierParameters is used here to match the Python result:
In[6]:= |
Out[6]= |
Compute the distance between the two results:
In[7]:= |
Out[7]= |
Terminate the external session:
In[8]:= |
Wolfram Language 14.0 (January 2024) or above
This work is licensed under a Creative Commons Attribution 4.0 International License