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

Different ways to create an empty NumPy array in Python

P: 4
What are the different ways to create an empty NumPy array in Python? Can you answer this?
Dec 3 '18 #1
Share this Question
Share on Google+
1 Reply

P: 5
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)
Dec 5 '18 #2

Post your reply

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