VOOZH about

URL: https://www.geeksforgeeks.org/python/python-numpy-expand_dims-method/

⇱ Python | Numpy.expand_dims() method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Python | Numpy.expand_dims() method

Last Updated : 17 Sep, 2019
With the help of Numpy.expand_dims() method, we can get the expanded dimensions of an array by using Numpy.expand_dims() method.
Syntax : Numpy.expand_dims() Return : Return the expanded array.
Example #1 : In this example we can see that using Numpy.expand_dims() method, we are able to get the expanded array using this method. Output :
(2, ) (1, 2)
Example #2 :
Output :
(2, 2) (1, 2, 2)
Comment
Article Tags: