Python Forum

Full Version: creating an empty NumPy array in Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Explain different ways to create an empty NumPy array in Python.
sounds like a homework question.
I refer you to numpy documentation: https://docs.scipy.org/doc/
We’ll talk about two methods to create NumPy array-

First method-
>>> import numpy
>>> numpy.array([])
array([], dtype=float64)
Second method-
>>> numpy.empty(shape=(0,0))