Skip to content

Numpy Basic

Demonstrates NumPy integration — CPython C extension support. PythonEmbed runs real CPython, so all C extensions work natively.

View source

Key Points

  • Real CPython means all C extensions work: numpy, scipy, torch, matplotlib
  • Array creation, operations, broadcasting
  • Matrix multiplication (@ operator)
  • Linear algebra (np.linalg)
  • Random number generation
  • Results returned to Java as typed lists

Run It

./gradlew :python-embed-examples:numpy-basic:run