Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add N-Dimensional Array Creator snippet#260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Debanjan110d wants to merge4 commits intoquicksnip-dev:main
base:main
Choose a base branch
Loading
fromDebanjan110d:n-dimensional-array-snippet

Conversation

@Debanjan110d
Copy link

@Debanjan110dDebanjan110d commentedFeb 16, 2025
edited
Loading

Description

Type of Change

  • ✨ New snippet
  • 🛠 Improvement to an existing snippet
  • 🐞 Bug fix
  • 📖 Documentation update
  • 🔧 Other (please describe):

Checklist

  • I have tested my code and verified it works as expected.
  • My code follows the style and contribution guidelines of this project.
  • Comments are added where necessary for clarity.
  • Documentation has been updated (if applicable).
  • There are no new warnings or errors from my changes.

Related Issues

Closes #

Additional Context

Screenshots (Optional)

Click to view screenshots

Copy link
Collaborator

@Mathys-GasnierMathys-Gasnier left a comment

Choose a reason for hiding this comment

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

Hey, Thank you for your contribution.

After reviewing your PR we've found that the snippet you are adding doesn't match the scope of Quicksnip.
As it is an example instead of a snippet
Please make it so your snippet match the guidelines before further reviewing can take place

If no fix is provided within 7-10 days this PR will be closed without further notice

@Debanjan110d
Copy link
Author


Hi@Mathys-Gasnier ,

Thank you for reviewing my pull request. I've updated the snippet to better align with Quicksnip's guidelines. The revised version is now more concise, follows the snippet format, and includes a clear usage example within the snippet itself.

Here’s the updated snippet:


Title: N-Dimensional Array Creator
Description: Creates an N-dimensional NumPy array filled with a single element.
Author: Debanjan110d
Tags: numpy, arrays, python, n-dimensional

importnumpyasnpdefcreate_n_dimensional_array(n,fill_value=1):"""Creates an N-dimensional NumPy array filled with a given value."""returnnp.full([1]*n,fill_value)# Example usage:arr=create_n_dimensional_array(3)print(arr.ndim)# Output: 3print(arr)# Output: [[[1]]]

I appreciate your time and feedback. Please let me know if any further refinements are needed.

Thank you!


"""Creates an N-dimensional NumPy array filled with a given value."""
return np.full([1] * n, fill_value)

# Example usage:
Copy link
Collaborator

Choose a reason for hiding this comment

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

the usage comment should be# Usage: to follow our standard

Copy link
Author

Choose a reason for hiding this comment

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

Ok

@Mathys-Gasnier
Copy link
Collaborator

Oh and btw, i've just noticed that your folder is named[numpy} instead of[numpy]

@Debanjan110d
Copy link
Author

I have changed nad modified whats needed so please check it out

@Mathys-Gasnier
Copy link
Collaborator

You need to have an example section, I was telling you to un comment it, not to delete it.
Have something like this:

# Usage:arr = create_n_dimensional_array(3)print(arr.ndim) # Output: 3

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

Reviewers

@Mathys-GasnierMathys-GasnierMathys-Gasnier requested changes

@psychlone77psychlone77Awaiting requested review from psychlone77

@saminjaysaminjayAwaiting requested review from saminjay

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Debanjan110d@Mathys-Gasnier

[8]ページ先頭

©2009-2025 Movatter.jp