numpy.matlib.empty() function return a new matrix of given shape and type, without initializing entries.
Syntax : numpy.matlib.empty(shape, dtype = None, order = ‘C’)
Parameters :
shape : [int or tuple of int] Shape of the empty matrix.
dtype : [data-type, optional] Desired output data-type.
order : [{‘C’, ‘F’}, optional] Whether to store multi-dimensional data in row-major (C-style) or column-major (Fortran-style) order in memory.
Return : [matrix] A new matrix of given shape and type, without initializing entries.
Code #1 :
# Python program explaining # numpy.matlib.empty() function # importing numpy as geek # and importing matlib module import numpy as geek import numpy.matlib # filled with random data gfg = geek.matlib.empty((2, 2)) # output will be random print (gfg) |
Output :
[[ 6.91957648e-310 1.90383493e-316] [ 6.91957669e-310 5.30409905e-317]]
Code #2 :
# Python program explaining # numpy.matlib.empty() function # importing numpy as geek # and importing matlib module import numpy as geek import numpy.matlib # filled with random data gfg = geek.matlib.empty((2, 2), dtype = int) # output will be random print (gfg) |
Output :
[[139855860099992 40294208] [139855825297024 10730496]]
Recommended Posts:
- Python - Call function from another function
- Wand function() function in Python
- Returning a function from a function - Python
- wxPython - GetField() function function in wx.StatusBar
- How to write an empty function in Python - pass statement?
- Function Decorators in Python | Set 1 (Introduction)
- Vulnerability in input() function – Python 2.x
- Function Annotations in Python
- Sorted() function in Python
- Ways to sort list of dictionaries by values in Python - Using lambda function
- Python Numbers | choice() function
- Python | askopenfile() function in Tkinter
- Python | Binding function in Tkinter
- floor() and ceil() function Python
- Sum 2D array in Python using map() function
- ord() function in Python
- sum() function in Python
- round() function in Python
- id() function in Python
- vars() function in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

