All Projects → nschloe → npx

nschloe / npx

Licence: BSD-3-Clause License
Some useful extensions for NumPy

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to npx

CS231n
My solutions for Assignments of CS231n: Convolutional Neural Networks for Visual Recognition
Stars: ✭ 30 (+25%)
Mutual labels:  numpy
npstreams
Streaming operations on NumPy arrays
Stars: ✭ 28 (+16.67%)
Mutual labels:  numpy
data-analysis-using-python
Data Analysis Using Python: A Beginner’s Guide Featuring NYC Open Data
Stars: ✭ 81 (+237.5%)
Mutual labels:  numpy
sklearn-predict
机器学习数据,预测趋势并画图
Stars: ✭ 16 (-33.33%)
Mutual labels:  numpy
Data-Analyst-Nanodegree
Kai Sheng Teh - Udacity Data Analyst Nanodegree
Stars: ✭ 42 (+75%)
Mutual labels:  numpy
python-programming-for-data-science
Content from the University of British Columbia's Master of Data Science course DSCI 511.
Stars: ✭ 29 (+20.83%)
Mutual labels:  numpy
DataSciPy
Data Science with Python
Stars: ✭ 15 (-37.5%)
Mutual labels:  numpy
The-Data-Visualization-Workshop
A New, Interactive Approach to Learning Data Visualization
Stars: ✭ 59 (+145.83%)
Mutual labels:  numpy
array-api-comparison
Data and tooling to compare the API surfaces of various array libraries.
Stars: ✭ 46 (+91.67%)
Mutual labels:  numpy
Live-Video-Sketching-through-webcam-using-OpenCv-Python
Computer Vision model creates a live video sketch of frames through real time web cam video. Source code is written in python and model is based on OpenCV. Keras and Numpy have been used to optimize the performance of the model and posterize frames
Stars: ✭ 29 (+20.83%)
Mutual labels:  numpy
python-machine-learning-book-2nd-edition
<머신러닝 교과서 with 파이썬, 사이킷런, 텐서플로>의 코드 저장소
Stars: ✭ 60 (+150%)
Mutual labels:  numpy
dipiper
基于nodejs的股票数据爬虫
Stars: ✭ 83 (+245.83%)
Mutual labels:  numpy
jun
JUN - python pandas, plotly, seaborn support & dataframes manipulation over erlang
Stars: ✭ 21 (-12.5%)
Mutual labels:  numpy
Machine-Learning
This repository contains notebooks that will help you in understanding basic ML algorithms as well as basic numpy excercise. 💥 🌈 🌈
Stars: ✭ 15 (-37.5%)
Mutual labels:  numpy
visions
Type System for Data Analysis in Python
Stars: ✭ 136 (+466.67%)
Mutual labels:  numpy
alvito
Alvito - An Algorithm Visualization Tool for Python
Stars: ✭ 52 (+116.67%)
Mutual labels:  numpy
python-twelve-tone
🎶 12-tone matrix to generate dodecaphonic melodies 🎶
Stars: ✭ 68 (+183.33%)
Mutual labels:  numpy
support-tickets-classification
This case study shows how to create a model for text analysis and classification and deploy it as a web service in Azure cloud in order to automatically classify support tickets. This project is a proof of concept made by Microsoft (Commercial Software Engineering team) in collaboration with Endava http://endava.com/en
Stars: ✭ 142 (+491.67%)
Mutual labels:  numpy
Python-Matematica
Explorando aspectos fundamentais da matemática com Python e Jupyter
Stars: ✭ 41 (+70.83%)
Mutual labels:  numpy
SymJAX
Documentation:
Stars: ✭ 103 (+329.17%)
Mutual labels:  numpy

npx

PyPi Version PyPI pyversions GitHub stars Downloads

gh-actions codecov LGTM Code style: black

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

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

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

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:

memory usage

Relevant issue reports:

unique

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

import npx
import numpy as np

a = np.random.randint(0, 5, size=(100, 2))

npx.unique_rows(a, return_inverse=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

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

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].