Function Repository Resource:

# SciPyObject

A minimal PythonObject configuration for the SciPy package

Contributed by: Igor Bakshee
 ResourceFunction["PythonObject"][…,"Configuration"→ResourceFunction["SciPyObject"]] returns a PythonObject with a special configuration for the Python package SciPy.

## Details

The Python package SciPy provides algorithms for optimization, integration, interpolation, eigenvalue problems, algebraic equations, differential equations, statistics and other classes of problems.
ResourceFunction["SciPyObject"] sets up a configuration of the resource function PythonObject that makes working with the Python package more convenient by generating SparseArray objects in the results.
At this time, ResourceFunction["SciPyObject"] is rudimentary and limited to only providing a single Normal form of a Python object.

## Examples

### Basic Examples (5)

Create a Python object for the SciPy's compressed sparse row matrix:

 In[1]:=
 Out[1]=

Define a sparse matrix in Python:

 In[2]:=
 Out[2]=

Convert the Python object to SparseArray:

 In[3]:=
 Out[3]=

Display in the dense form:

 In[4]:=
 Out[37]=

Clean up by closing the Python session:

 In[38]:=

### Applications (6)

The resource function ProbNumObject uses the SciPyObject configuration for sparse matrices:

 In[39]:=
 Out[39]=

Use Python's random number generator:

 In[40]:=
 Out[40]=

Create a random sparse symmetric positive definite matrix with ProbNumObject:

 In[41]:=
 Out[41]=

Convert the Python-side matrix to SparseArray:

 In[42]:=
 Out[42]=

Display in the dense form:

 In[43]:=
 Out[89]=

Clean up by closing the Python session:

 In[90]:=

## Version History

• 1.0.0 – 15 March 2022

## Author Notes

In its current form, this function is mainly a placeholder, but it is already used in ProbNumObject.