Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.3%) to scientific vocabulary
Keywords
Repository
Some useful extensions for NumPy
Basic Info
Statistics
- Stars: 28
- Watchers: 3
- Forks: 6
- Open Issues: 1
- Releases: 31
Topics
Metadata Files
README.md
npx
NumPy is a large library used everywhere in scientific computing. That's why breaking backwards-compatibility comes at a significant cost and is almost always avoided, even if the API of some methods is arguably lacking. This package provides drop-in wrappers "fixing" those.
scipyx does the same for SciPy.
If you have a fix for a NumPy method that can't go upstream for some reason, feel free to PR here.
dot
```python import npx import numpy as np
a = np.random.rand(3, 4, 5) b = np.random.rand(5, 2, 2)
out = npx.dot(a, b)
out.shape == (3, 4, 2, 2)
```
Forms the dot product between the last axis of a and the first axis of b.
(Not the second-last axis of b as numpy.dot(a, b).)
np.solve
```python import npx import numpy as np
A = np.random.rand(3, 3) b = np.random.rand(3, 10, 4)
out = npx.solve(A, b)
out.shape == (3, 10, 4)
```
Solves a linear equation system with a matrix of shape (n, n) and an array of shape
(n, ...). The output has the same shape as the second argument.
sum_at/add_at
python
npx.sum_at(a, idx, minlength=0)
npx.add_at(out, idx, a)
Returns an array with entries of a summed up at indices idx with a minimum length of
minlength. idx can have any shape as long as it's matching a. The output shape is
(minlength,...).
The numpy equivalent numpy.add.at is much
slower:
Relevant issue reports:
unique
```python import npx
a = [0.1, 0.15, 0.7] a_unique = npx.unique(a, tol=2.0e-1)
assert all(a_unique == [0.1, 0.7]) ```
npx's unique() works just like NumPy's, except that it provides a parameter
tol (default 0.0) which allows the user to set a tolerance. The real line
is essentially partitioned into bins of size tol and at most one
representative of each bin is returned.
unique_rows
```python import npx import numpy as np
a = np.random.randint(0, 5, size=(100, 2))
npx.uniquerows(a, returninverse=False, return_counts=False) ```
Returns the unique rows of the integer array a. The numpy alternative np.unique(a, axis=0) is slow.
Relevant issue reports:
isin_rows
```python import npx import numpy as np
a = [[0, 1], [0, 2]] b = np.random.randint(0, 5, size=(100, 2))
npx.isin_rows(a, b) ```
Returns a boolean array of length len(a) specifying if the rows a[k] appear in b.
Similar to NumPy's own np.isin which only works for scalars.
mean
```python import npx
a = [1.0, 2.0, 5.0] npx.mean(a, p=3) ```
Returns the generalized mean of a
given list. Handles the cases +-np.inf (max/min) and0 (geometric mean) correctly.
Also does well for large p.
Relevant NumPy issues:
License
This software is published under the BSD-3-Clause license.
Owner
- Name: Sigma
- Login: sigma-py
- Kind: organization
- Repositories: 8
- Profile: https://github.com/sigma-py
Numerical computation in Python
GitHub Events
Total
- Watch event: 3
Last Year
- Watch event: 3
Committers
Last synced: 11 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Nico Schlömer | n****r@g****m | 135 |
| zoj | 4****3 | 1 |
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 1
- Total pull requests: 33
- Average time to close issues: N/A
- Average time to close pull requests: 5 minutes
- Total issue authors: 1
- Total pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 0.03
- Merged pull requests: 33
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: 1 minute
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
- nschloe (4)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 23,520 last-month
- Total docker downloads: 98
- Total dependent packages: 8
- Total dependent repositories: 7
- Total versions: 31
- Total maintainers: 1
pypi.org: npx
Some useful extensions for NumPy
- Documentation: https://npx.readthedocs.io/
- License: Copyright 2021-present Nico Schlömer Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
Latest release: 0.1.6
published over 1 year ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v4 composite
- actions/setup-python v5 composite
- pypa/gh-action-pypi-publish release/v1 composite
- actions/checkout v4 composite
- actions/setup-python v5 composite
- codecov/codecov-action v4 composite
- pre-commit/action v3.0.0 composite
- numpy >= 1.20.0