NumPy | Python Methods and Functions

Using the

method, we can get the cholesky decomposition using **np.cholesky()** ` np.cholesky () `

.

Syntax:`np.cholesky (matrix)`

Return:Return the cholesky decomposition.

Example # 1:

In this example, we can see that using`np.cholesky ()`

, we can get the Cholesky decomposition into matrix shape using this method.

`# NumPy import`

`import`

`numpy as np`

`a`

`=`

`np.array ([[`

`2`

`,`

`-`

`3j`

`], [`

`5j`

`,`

`15`

`]])`

`# using the np.cholesky () method`

`gfg`

`=`

`np.linalg.cholesky (a)`

`(gfg)`

Output:[[1.41421356 + 0.j, 0. + 0.j]

[0. + 3.53553391j, 1.58113883 + 0.j]]

Example # 2:

`# NumPy import`

`import`

`numpy as np`

`a`

`=`

`np.array ([[`

`12`

`,`

`-`

`13j`

`], [`

`4j`

`,`

`8`

`]])`

`# using the np.cholesky () method`

`gfg`

`=`

`np.linalg.cholesky (a)`

`(gfg)`

Output:[[3.46410162 + 0.j, 0. + 0.j]

[0. + 1.15470054j, 2.5819889 + 0.j]]

Mark Lutz is the global leader in Python training, author of the oldest and best-selling Python texts, and a pioneer in the Python community since 1992.

Mark Lutz is the author of the found...

11/08/2021

Learning to code is tremendous fun as you can get instant results, no matter how much more you have to learn. In fact, it’s such fun creating games and programs that it feels effortless once you’r...

23/09/2020

Big data is, admittedly, an overhyped buzzword used by software and hardware companies to boost their sales. Behind the hype, however, there is a real and extremely important technology trend with imp...

10/07/2020

Automate the Boring Stuff with Python PDF, 2nd Edition: Practical Programming for Total Beginners Illustrated Edition. The second edition of this Python bestseller (over 100,000 copies sold in prin...

22/08/2021

X
# Submit new EBook