numpy

Science

Numerical computing

Try numpy in PyRun

What is numpy?

NumPy is the foundational package for scientific computing in Python. It provides a powerful N-dimensional array object, along with tools for integrating C and C++ code, linear algebra, Fourier transforms, and random number generation. Nearly every data science and machine learning library in the Python ecosystem is built on top of NumPy.

With PyRun, you can use NumPy directly in your browser — no pip install, no virtual environment, no setup. The full NumPy library is bundled inside Pyodide's WebAssembly distribution and loads automatically when your code imports it. This makes PyRun one of the fastest ways to experiment with numerical computing without touching your local machine.

Code Example

Matrix multiplication, dot product, and basic statistics.

NumPy Matrix Ops
Try in Editor
import numpy as np

# Create two 3x3 matrices
A = np.array([[1, 2, 3],
              [4, 5, 6],
              [7, 8, 9]])

B = np.array([[9, 8, 7],
              [6, 5, 4],
              [3, 2, 1]])

print("Matrix A:\n", A)
print("\nMatrix B:\n", B)

# Matrix Multiplication
C = np.dot(A, B)
print("\nDot Product (A · B):\n", C)

# Element-wise operations
print("\nA + B:\n", A + B)
print("\nMean of A:", np.mean(A))
print("Std of A:", np.std(A).round(4))

Why run numpy in PyRun?

  • Zero setup — no pip install, no virtual environment, no Python download
  • Instant results — powered by WebAssembly, runs locally in your browser
  • Share your code — generate a link and anyone can run it instantly
  • Works offline — after first load, PyRun runs without internet
Open editor with numpy example

Related Packages