VOOZH about

URL: https://www.geeksforgeeks.org/python/python-sympy-ones-method/

⇱ Python | sympy.ones() method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Python | sympy.ones() method

Last Updated : 29 Jun, 2019
With the help of sympy.ones() method, we can create a matrix having dimension nxm and filled with ones by using sympy.ones() method.
Syntax : sympy.ones() Return : Return a ones matrix.
Example #1 : In this example, we can see that by using sympy.ones() method, we are able to create the ones matrix having dimension nxn all filled with ones, where nxm will be pass as a parameter. Output :
Matrix([ [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]])
Example #2 :
Output :
Matrix([ [1, 1], [1, 1], [1, 1]])
Comment
Article Tags:
Article Tags: