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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Debanjan110d wants to merge 4 commits into quicksnip-dev:main
base: main
Choose a base branch
Loading
from Debanjan110d:n-dimensional-array-snippet
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
changed and added th example
  • Loading branch information
Debanjan110d committed Mar 15, 2025
commit 1adf94e7e256a3e8a18312c46d73a33d4b65b63e
5 changes: 4 additions & 1 deletion snippets/python/[numpy]/n_dimensional_array.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ 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)


# Usage example
if __name__ == '__main__':
array = create_n_dimensional_array(n=3, fill_value=10)
print(array)
```

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /