Learn Before
Concept

Interacting with NumPy

SciPy builds directly on NumPy arrays. This snippet shows how to create NumPy arrays of different dimensionality and dtype, including 1-D, 2-D, and complex-valued arrays:

import numpy as np a = np.array([1, 2, 3]) b = np.array([(1+5j, 2j, 3j), (4j, 5j, 6j)]) c = np.array([[(1.5, 2, 3), (4, 5, 6)], [(3, 2, 1), (4, 5, 6)]])

0

1

Updated 2026-07-06

Tags

Python Programming Language

Data Science