Jump to content

Documentação da função np.trace() Python


Recommended Posts

Na documentação está:
>>> np.trace(np.eye(3))
>>> a = np.arange(8).reshape((2,2,2))
>>> np.trace(a)
array([6, 8])

Contudo na perspectiva que procurei e pesquisei obtive:

         [ [0, 1],

           [2, 3]



              [4, 5],

              [6, 7]




Ele divide em matriz a[0]: [0, 1], [2, 3]

e matriz em matriz a[1]: [4, 5], [6, 7]

presumo eu, o resultado pensando assim será:

np.trace(a[0]) =  3
np.trace(a[1]) = 11

Qual a vossa perspectiva?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.