423,846 Members | 1,959 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,846 IT Pros & Developers. It's quick & easy.

Different ways to create an empty NumPy array in Python

P: 2
What are the different ways to create an empty NumPy array in Python? Can you answer this?
1 Week Ago #1
Share this Question
Share on Google+
1 Reply


P: 3
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))
array([], shape=(0, 0), dtype=float64)
1 Week Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.