Skip to content

Conversation

@ylevental
Copy link
Contributor

Description

Added comprehensive documentation for the NumPy ndarray.diagonal() method, which returns specified diagonal elements from an array.

This contribution includes:

  • Complete method documentation with YAML front matter
  • Detailed syntax section with parameter descriptions
  • Three practical examples covering 2D arrays, rectangular matrices, and multi-dimensional arrays
  • Interactive codebyte example demonstrating various diagonal extractions
  • Clear explanations of how the method differs from .trace() and handles different array dimensions

File added: content/numpy/concepts/ndarray/terms/diagonal/diagonal.md

Issue Solved

Closes #7826

Type of Change

  • Adding a new entry

Checklist

  • All writings are my own.
  • My entry follows the Codecademy Docs style guide.
  • My changes generate no new warnings.
  • I have performed a self-review of my own writing and code.
  • I have checked my entry and corrected any misspellings.
  • I have made corresponding changes to the documentation if needed.
  • I have confirmed my changes are not being pushed from my forked main branch.
  • I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • I have linked any issues that are relevant to this PR in the Issues Solved section.
@mamtawardhani mamtawardhani self-assigned this Oct 31, 2025
Copy link
Collaborator

@mamtawardhani mamtawardhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for a second review! 🚀

@mamtawardhani mamtawardhani added python Python entries new entry New entry or entries status: review 1️⃣ completed numpy NumPy entries status: ready for next review hacktoberfest-accepted Indicates the PR was approved, merged, and pertains to Hacktoberfest labels Nov 3, 2025
@Sriparno08 Sriparno08 self-assigned this Nov 3, 2025
@Sriparno08 Sriparno08 added status: under review Issue or PR is currently being reviewed and removed status: ready for next review labels Nov 3, 2025
Copy link
Collaborator

@Sriparno08 Sriparno08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, @ylevental!

@Sriparno08 Sriparno08 merged commit ed00ec3 into Codecademy:main Nov 4, 2025
7 checks passed
@github-actions
Copy link

github-actions bot commented Nov 4, 2025

👋 @ylevental
You have contributed to Codecademy Docs, and we would like to know more about you and your experience.
Please take a minute to fill out this four question survey to help us better understand Docs contributions and how we can improve the experience for you and our learners.
Thank you for your help!

🎉 Your contribution(s) can be seen here:

https://www.codecademy.com/resources/docs/numpy/ndarray/diagonal

Please note it may take a little while for changes to become visible.
If you're appearing as anonymous and want to be credited, visit the linked accounts page and ensure that your GitHub account is linked.

@Sriparno08 Sriparno08 added status: review 2️⃣ completed and removed status: under review Issue or PR is currently being reviewed labels Nov 4, 2025
@ylevental ylevental deleted the add-numpy-ndarray-diagonal branch November 4, 2025 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted Indicates the PR was approved, merged, and pertains to Hacktoberfest new entry New entry or entries numpy NumPy entries python Python entries status: review 1️⃣ completed status: review 2️⃣ completed

3 participants