-
-
Notifications
You must be signed in to change notification settings - Fork 129
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 our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add N-Dimensional Array Creator snippet #260
Conversation
There was a problem hiding this 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
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
import numpy as np def create_n_dimensional_array(n, fill_value=1): """Creates an N-dimensional NumPy array filled with a given value.""" return np.full([1] * n, fill_value) # Example usage: arr = create_n_dimensional_array(3) print(arr.ndim) # Output: 3 print(arr) # Output: [[[1]]]
I appreciate your time and feedback. Please let me know if any further refinements are needed.
Thank you!
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
Oh and btw, i've just noticed that your folder is named [numpy}
instead of [numpy]
I have changed nad modified whats needed so please check it out
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
Uh oh!
There was an error while loading. Please reload this page.
Description
Type of Change
Checklist
Related Issues
Closes #
Additional Context
Screenshots (Optional)
Click to view screenshots