Skip to content

Conversation

@Aggarwalmansi
Copy link

This PR introduces a new entry for the .diagonal() method under NumPy ndarray in content/numpy/concepts/ndarray/terms/diagonal/diagonal.md.

It includes:

A detailed explanation of the .diagonal() method and its use cases.

Syntax and parameter descriptions.

Examples demonstrating usage with 2D and 3D arrays, including diagonals with offsets and axis selection.

A compilable Codebyte example showing how to compute the trace of a matrix using .diagonal().

FAQs addressing common questions and clarifying differences from np.diag().
issue:#7826

@CLAassistant
Copy link

CLAassistant commented Oct 24, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ Aggarwalmansi
✅ mamtawardhani
❌ Mansi Agarwal


Mansi Agarwal seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@mamtawardhani mamtawardhani self-assigned this Oct 25, 2025
@mamtawardhani mamtawardhani linked an issue Oct 25, 2025 that may be closed by this pull request
3 tasks
@mamtawardhani
Copy link
Collaborator

@Aggarwalmansi please sign the CLA using your local ID also

@Aggarwalmansi
Copy link
Author

I have signed it but its not updating , still i am trying multiple times but the page open as you have signed .Please check once and please merge if everything is fine

@mamtawardhani
Copy link
Collaborator

That's because its your local id. I would suggest raising another PR then

@mamtawardhani
Copy link
Collaborator

I'm closing this issue @Aggarwalmansi.

Also, please follow the protocols at Codecademy.
First, ask for the issue to be assigned to you, once the issue has been assigned, only then raise a PR for that issue.

Otherwise, we'll have to close the PR. Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Term Entry] Python NumPy - ndarray: diagonal()

3 participants