What are the different ways to create an empty numpy array in python?



What are the different ways to create an empty numpy array in python?..

Answer / Veer Vikram Singh

Creating an empty NumPy array can be done using several methods: 1) np.zeros(shape), where shape is the size of the array, initializes all elements to zero. 2) np.empty(shape), which returns a contiguous array with an uninitialized data type. 3) np.array([]).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

List down some of the pdb commands for debugging python programs?

1 Answers  


What are the applications of python?

1 Answers  


What applications can you build with python?

1 Answers  


Does Python support enums?

1 Answers  


How to sort a dictionary by key in python?

1 Answers  


What is decorators?

1 Answers  


Do you know how memory is managed in python?

1 Answers  


Is string empty python?

1 Answers  


How many functions are in python?

1 Answers  


Explain about pickling and unpickling?

1 Answers  


Is python an oops?

1 Answers  


What made you to choose python as a programming language?

1 Answers  


Categories