Saravanan666/pypi-org huggingface dataset:
Package: numpy-datasets
/**/All dataset utilities (downloading/loading/batching/processing) in NumpyThis is an under-development research project, not an official product, expect bugs and sharp edges; please help by trying it out, reporting bugs.Reference docsWhat is and why doing numpy-datasets ?First, numpy-datasets offers out-of-the-box dataset download and loading only based on Numpy and core Python libraries.Second, numpy-datasets offers utilities such as (mini-)batching a.k.a looping through a dataset one chunk at a time, or preprocessing techniques that are highly suited for machine learning and deep learning pipelines.Third, numpy-datasets offers many options to transparently deal with very large datasets. For example, automatic mini-batching with a priori caching of the next batch, online preprocessing, and the likes.Fourth, numpy-datasets does not only focus on computer vision datasets but also offers plenty in time-series datasets, with a constantly groing collection of implemented datasets.Minimal Exampleimportsysimportsymjaxassjimportsymjax.tensorasT# create our variable to be optimizedmu=T.Variable(T.random.normal((),seed=1))# create our costcost=T.exp(-(mu-1)**2)# get the gradient, notice that it is itself a tensor that can then# be manipulated as wellg=sj.gradients(cost,mu)print(g)# (Tensor: shape=(), dtype=float32)# create the compield function that will compute the cost and apply# the update onto the variablef=sj.function(outputs=cost,updates={mu:mu-0.2*g})foriinrange(10):print(f())# 0.008471076# 0.008201109# 0.007946267# ...InstallationInstallation is direct with pip as described in thisguide.
Package: numpyDealer
numpyDealer version 1.0.0This package is designed to be used to speed up operations involving decks of playing cards by utilizing the popular Numpy package.The meat of the package is numpyDeck. This is a managed array of playing cards, starting at the standard 52.Below I will go through the functions of the Card object, then the Deck object (which holds a numpy array of Cards).Additionally, I intend to add more examples, documentation, and features soon, so please feel free to send feedback!Finally, the license MIT. I would love to see what the world does with my stuff, but y'all do what you want with it.Thanks for downloading, have fun!Note: I use Jokers as sentry values in Deck functions.CardTo import:from numpyDealer.Card import Card__init__(rank (string), suit (string), value (int))EX: ace_of_spades = Card("A","S",14)The == operator comapares based on rank and suit.The > and < operators compares based on value.The - operator returns the distance between 2 cards.EX: King of Hearts - Ten of Clubs = 13__str__ calls the Card as a string, and returns the Rank and SuitEX: ace_of_spades.__str__() returns "AS"numpyDeckto import:from numpyDealer.numpyDeck import Deck__init__()EX: new_deck = Deck()This creates a full deck, in orderAll Ranks are 1 character strings, 2,3..., 9,T,J,Q,K,A.All Suits are 1 character strings, S,H,C,D__iter__() returns an iterable version, lets you use for loops.deal() returns the top Card from the deck, and removes it.dealByRankSuit(rank, suit) deals the specified card, if it is in the deck.else returns a red joker. (Card("Joker ", "Red", -1))dealRand() deals a random card.+ and - operators are overloaded, do what you'd think.They CAN take iterable objects of Cards, or just single CardsNote on the print functions: These are available, but you can use a for loop to print each element.print() prints a list of the cards in the deck, in the order they are in.printBySuit() prints all the cards in the deck in 4 rows, 1 for each suit.THIS DOES NOT SORT THE DECK, ONLY PRINTS THEM IN THE ROWSTHIS DOES NOT PRINT JOKERS, USE THE OTHER PRINTS TO FIND THOSEshuffle() Shuffles the deck. DOES NOT return a value.
Package: numpydoc
This package provides thenumpydocSphinx extension for handling
docstrings formatted according to the NumPy documentation format.
The extension also adds the code description directivesnp:function,np-c:function, etc.numpydoc requires Python 3.8+ and sphinx 5+.For usage information, please refer to thedocumentation.Thenumpydoc docstring guideexplains how
to write docs formatted for this extension, and theuser guideexplains how to use it with Sphinx.
Package: numpydoc-linter
NumpydoclintNumpydoclint is a linter forNumpy styledocstrings.$ numpydoclint -vv asgard midgard/thor.py
asgard/loki.py:12 in function asgard.loki.mischief:
    GL03 Double line break found
asgard/odin.py:10 in type asgard.odin.Allfather:
    SA04 Missing description for See Also 'Yggdrasil' reference
midgard/thor.py:20 in function thor.Thor.strike:
    PR01 Parameters {'mjolnir'} not documented
Errors found in 3 out of 9 objects checked.Numpydoclint uses static file analysis to identify code objects and then uses thenumpydoc.validatemodule for validation, outputting correspondingerror codesalong with explanatory comments.InstallationYou can install Numpydoclint via thePIPpackage manager:$pipinstallnumpydoc-linterAlternatively, if you wish to install from the source code, follow these steps. Clone the repository and usePoetryto manage the project dependencies specified inpyproject.toml:$gitclonehttps://github.com/nickuzmenkov/numpydoclint.git
$cdnumpydoclint
$poetryinstallUsageBasic usage examples, as well as more advanced usage scenarios are covered in detail in theOfficial Documentation.
Package: numpy-dynamic-array
Numpy Dynamic ArrayDynamically resizing Numpy array.A dynamic array expands as you add more elements. So you don't need to determine the size ahead of time. The version
present here is focused on being compatible with the typical Numpy indexing and functions.Installationpip install numpy_dynamic_arrayUsageBasicsfromnumpy_daimportDynamicArraydata=DynamicArray(shape=2)a=np.linspace(0,9,10)data.append(a)# requires resize (done automatically)print(data)# [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]IndexingSetting values with indexingdata=DynamicArray(shape=2)data.append(np.linspace(0,9,10))data[3]=40print(data)# [0, 1, 2, 3, 40, 5, 6, 7, 8, 9]Setting values with indexing (outside current array size)
Setindex_expansion=Truedata=DynamicArray(shape=2,index_expansion=True)data[5]=1print(data)# [0, 0, 0, 0, 0, 1]Setting values with slices (outside current array size)
Setindex_expansion=Truedata=DynamicArray(shape=2,index_expansion=True)data[5:8]=[1,2,3]print(data)# [0, 0, 0, 0, 0, 1, 2, 3]OperatorsEquality:np_array=np.linspace(0,9,10)data=DynamicArray()data.append(np_array)print(all(data==np_array))# TrueAddition:np_array=np.linspace(0,9,10)data=DynamicArray()data.append(np_array)print(all((data+7.5)==(np_array+7.5)))# TrueOther supported oparators:floordiv (//)mod (%)mul (*)neg (-)pow (**)truediv(/)sub (-)len (len())Numpy Functionsnp_array=np.linspace(0,9,10)data=DynamicArray()data.append(np_array)print(data.max())# 9np_array=np.linspace(0,9,10)data=DynamicArray()data.append(np_array)print(np.abs(data-5))# [5. 4. 3. 2. 1. 0. 1. 2. 3. 4.]Multidimensional arraysUse the shape to specify initial ndarray with correct dimensions.data=DynamicArray(shape=(2,2))# requires resizea=np.linspace(0,9,10).reshape(5,2)data.append(a)For more examples look at the tests folder.
Package: numpyencoder
numpyencoderCustom Python JSON encoder for handling Numpy data types.Example Use:fromnumpyencoderimportNumpyEncodernumpy_data=np.array([0,1,2,3])withopen(json_file,'w')asfile:json.dump(numpy_data,file,indent=4,sort_keys=True,separators=(', ',': '),ensure_ascii=False,cls=NumpyEncoder)
Package: numpy-ext
NumPy ExtensionsAn extension library forNumPythat implements common array operations not present in NumPy.npext.fill_na(...)npext.drop_na(...)npext.rolling(...)npext.expanding(...)npext.rolling_apply(...)npext.expanding_apply(...)# etcDocumentationAPI ReferenceInstallationRegular installation:pipinstallnumpy_extFor development:gitclonehttps://github.com/3jane/numpy_ext.gitcdnumpy_ext
pipinstall-e.[dev]# note: make sure you are using pip>=20ExamplesHere are few common examples of how the library is used. The rest is available in thedocumentation.Apply a function to a rolling window over the provided arrayimportnumpyasnpimportnumpy_extasnpexta=np.array([0,1,2,3,4,5,6,7,8,9])window=3npext.rolling_apply(np.sum,window,a)>array([nan,nan,3.,6.,9.,12.,15.,18.,21.,24.])Same as the above, but with a custom function, two input arrays and parallel computation usingjoblib:deffunc(array_first,array_second,param):return(np.min(array_first)+np.sum(array_second))*parama=np.array([0,1,2,3])b=np.array([3,2,1,0])npext.rolling_apply(func,2,a,b,n_jobs=2,param=-1)>array([nan,-5.,-4.,-3.])Same as the first example, but usingrollingfunction:a=np.array([0,1,2,3,4,5,6,7,8,9])window=3rolls=npext.rolling(a,window,as_array=True)np.sum(rolls,axis=1)>array([nan,nan,3.,6.,9.,12.,15.,18.,21.,24.])Apply a function with multiple output to a rolling window over the provided array, with no nans prependres=npext.rolling_apply(lambdax:(max(x),min(x)),3,np.array([1,2,5,1,6,4,0]),prepend_nans=False,)>array([[5,1],[5,1],[6,1],[6,1],[6,0]])LicenseThe software is distributed under MIT license.
Package: numpy-financial
NumPy FinancialThenumpy-financialpackage contains a collection of elementary financial
functions.Thefinancial functions in NumPyare deprecated and eventually will be removed from NumPy; seeNEP-32for more information.  This package is the replacement for the original
NumPy financial functions.The source code for this package is available athttps://github.com/numpy/numpy-financial.The importable name of the package isnumpy_financial.  The recommended
alias isnpf.  For example,>>> import numpy_financial as npf
>>> npf.irr([-250000, 100000, 150000, 200000, 250000, 300000])
0.5672303344358536
Package: numpy-flint
Rounded Floating Point ArithmeticThis package implements a roundedfloating pointintervals orflintdata-type
in python and NumPy. The floating point interval type contains a pair of numbers that
define the endpoint of an interval, and the exact value of a computation always lies
somewhere in that interval. This type addresses one shortcoming of floating point
numbers: equality comparisons. For this package, the equality operator for flints is
implemented such that any overlap of the interval will be treated as equal, and should
be though of as 'could be equal'.To use in python, import the flint package and declare the number as a flint type.fromflintimportflint# Floating point numbers sometimes don't make sensea=0.2b=0.6# This evaluate to Falseprint((a+a+a)==b)# Rounded floating point intervals will fix these issuesx=flint(0.2)y=flint(0.6)# This evalautes to Trueprint((x+x+x)==y)To use with NumPy, import NumPy as well and mark the array's dtype asflint.importnumpyasnpfromflintimportflinta=np.fill((3,),0.2,dtype=flint)b=flint(0.6)# This evaluates to Trueprint(np.sum(a)==b)Further useage examples as well as a full API can be found on theproject homepageInstallationBinary packages are avialable fromPyPI. Usepipto install the
binary package.>python-mpipinstallnumpy-flintIf there not a version for your system, you can visit theproject homepagewhich has instructions on building from source or contributing to the project.LicenseCopyright (c) 2023, Jef WagnerNumpy-flint is free software: you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation, either
version 3 of the License, or (at your option) any later version.Numpy-flint is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.You should have received a copy of the GNU General Public License along with
Numpy-flint. If not, seehttps://www.gnu.org/licenses/.
Package: numpy-fracadf
numpy-fracadfDetermine fractal order by the ADF testInstallationThenumpy-fracadfgit
repois available asPyPi
packagepip install numpy-fracadf
pip install git+ssh://git@github.com/ulf1/numpy-fracadf.gitUsagefromnumpy_fracadfimportfracadf2d=fracadf2(X,tau=1e-4,mmax=527)Check theexamplesfolder for notebooks.AppendixInstall a virtual envpython3.6-mvenv.venvsource.venv/bin/activatepip3install--upgradepippip3install-rrequirements.txtpip3install-rrequirements-dev.txtpip3install-rrequirements-demo.txtPython commandsJupyter for the examples:jupyter labCheck syntax:flake8--ignore=F401--exclude=$(grep-v'^#'.gitignore | xargs | sed-e's//,/g')PublishpandocREADME.md--frommarkdown--torst-s-oREADME.rstpythonsetup.pysdisttwineupload-rpypidist/*Clean upfind.-typef-name"*.pyc"|xargsrmfind.-typed-name"__pycache__"|xargsrm-rrm-r.pytest_cacherm-r.venv
Package: numpy-fracdiff
numpy-fracdiffFractional Difference for Time SeriesInstallationThenumpy-fracdiffgit
repois available asPyPi
packagepipinstallnumpy-fracdiffpipinstallgit+ssh://git@github.com/ulf1/numpy-fracdiff.gitUsageCheck theexamplesfolder for notebooks.AppendixInstall a virtual environmentpython3.6-mvenv.venvsource.venv/bin/activatepipinstall--upgradepippipinstall-rrequirements.txtpipinstall-rrequirements-dev.txtpipinstall-rrequirements-demo.txt(If your git repo is stored in a folder with whitespaces, then don’t use
the subfolder.venv. Use an absolute path without whitespaces.)Python commandsJupyter for the examples:jupyter labCheck syntax:flake8--ignore=F401--exclude=$(grep-v'^#'.gitignore | xargs | sed-e's//,/g')Run Unit Tests:pytestPublishpandocREADME.md--frommarkdown--torst-s-oREADME.rstpythonsetup.pysdisttwineupload-rpypidist/*Clean upfind.-typef-name"*.pyc"|xargsrmfind.-typed-name"__pycache__"|xargsrm-rrm-r.pytest_cacherm-r.venv
Package: numpy-hilbert-curve
numpy-hilbert-curveThis is a numpy-based implementation of Hilbert curves, for up to a few tens of
dimensions. AHilbert curveis a
continuousspace-filling curvethat lets you map from a single dimension into multiple dimensions.
In two dimensions, you get curves that look like this:In three dimensions, you get curves that look like this:This is working entirely in terms of integers, so the size of the (hyper-)
cube reflects the number of bits per dimension. You could normalize this to put
it into the unit hypercube with floating point numbers.The mechanics of the implementation rely on the Gray-code "correction"
procedure presented inSkilling, J. (2004, April). Programming the Hilbert curve. In AIP Conference
Proceedings (Vol. 707, No. 1, pp. 381-387). American Institute of Physics.This paper does a lot of bit twiddling in C.  I replicate this with
"bool-twiddling" in numpy, but of course numpy represents a bool value with 8
bits, so don't expect it to really have the same performance as the equivalent
C code.  However, my goal here (rather than write it in Cython) was to make it
easy to integrate with code you're already writing in Python with numpy.InstallationYou can install this via PyPI:$ pip install numpy-hilbert-curveUsageThe basic usage looks like this:importnumpyasnpfromhilbertimportdecode,encode# Turn an ndarray of Hilber integers into locations.# 2 is the number of dimensions, 3 is the number of bits per dimensionlocs=decode(np.array([1,2,3]),2,3)print(locs)# prints [[0 1]#         [1 1]#         [1 0]]# You can go the other way also, of course.H=encode(locs,2,3)print(H)# prints array([1, 2, 3], dtype=uint64)The reason things like Hilbert curves are interesting is because they preserve
some amount of locality.  In this figure, I'm gradually changing the color in
the Hilbert integers, using the "copper" colormap:In this picture, I'm doing the same thing in 3d:
Package: numpy-html
numpy-htmlA simple table renderer for numpy arrays. Provides a rich display hook for use with Jupyter Lab / Notebook. Inspired byxtensor.Installationpip install numpy-htmlExample inside Jupyter%load_extnumpy_htmlimportnumpyasnpnp.set_printoptions(threshold=5,edgeitems=2)np.arange(49).reshape(7,7)01⋯5678⋯1213⋮⋮⋱⋮⋮3536⋯40414243⋯4748
Package: numpyimage
npimageNeed to load pixel values from image files as numpy arrays, and hate having to remember whether you should use PIL, tifffile, matplotlib, or something else? Hate having to deal with the fact that those libraries all use different function names and syntaxes? Wish you could just provide a filename and get back a numpy array? This library'score.pydoes that, witharray = load(filename),save(array, filename), andshow(array)functions that let you easily handle a number of common image file formats without having to remember library-specific syntax. (Another choice of library to consider for accomplishing similar goals isimageio, which also supports loading videos through the FFmpeg wrapper librarypyav.)Want to draw simple shapes like lines, triangles, and circles into 3D numpy arrays? Frustrated that the python libraries you can find online likeopencvandskimage.drawwork on 2D arrays but not 3D? I wrote some functions ingraphics.pythat do the trick in 3D. (If you know of another library that can do this, please let me know!)Documentationcore.py: load, save, or show images.graphics.py: draw points, lines, triangles, circles, or spheres into 2D or 3D numpy arrays representing image volumes.nrrd_utils.py: compress or read metadata from.nrrdfiles.operations.py: perform operations on images.For now, check each function's docstring for more. A jupyter notebook demonstrating this package's functions will come later.InstallationAs is always the case in python, consider making a virtual environment (using your preference of conda, virtualenv, or virtualenvwrapper) before installing.Option 1:pip installfrom PyPI:pip install numpyimage(Unfortunately the namenpimagewas already taken on PyPI, sopip install npimagewill get you a different package.)Option 2:pip installdirectly from GitHub:pip install git+https://github.com/jasper-tms/npimage.gitOption 3:Firstgit clonethis repo and thenpip installit from your clone:cd ~/repos  # Or wherever on your computer you want to download this code to
git clone https://github.com/jasper-tms/npimage.git
cd npimage
pip install .After installing,you can import this package in python usingimport npimage(notimport numpyimage!)
Package: numpy-indexed
Numpy indexed operationsThis package contains functionality for indexed operations on numpy ndarrays, providing efficient vectorized functionality such as grouping and set operations.Rich and efficient grouping functionality:splitting of values by key-groupreductions of values by key-groupGeneralization of existing array set operation to nd-arrays, such as:uniqueuniondifferenceexclusive (xor)contains / in (in1d)Some new functions:indices: numpy equivalent of list.indexcount: numpy equivalent of collections.Countermode: find the most frequently occuring items in a setmultiplicity: number of occurrences of each key in a sequencecount_table: like R’s table or pandas crosstab, or an ndim version of np.bincountSome brief examples to give an impression hereof:# three sets of graph edges (doublet of ints)edges=np.random.randint(0,9,(3,100,2))# find graph edges exclusive to one of three setsex=exclusive(*edges)print(ex)# which edges are exclusive to the first set?print(contains(edges[0],ex))# where are the exclusive edges relative to the totality of them?print(indices(union(*edges),ex))# group and reduce values by identical keysvalues=np.random.rand(100,20)# and so on...print(group_by(edges[0]).median(values))Installation>condainstallnumpy-indexed-cconda-forgeor>pipinstallnumpy-indexedSee:https://pypi.python.org/pypi/numpy-indexedDesign decisions:This package builds upon a generalization of the design pattern as can
be found in numpy.unique. That is, by argsorting an ndarray, many
subsequent operations can be implemented efficiently and in a vectorized
manner.The sorting and related low level operations are encapsulated into a
hierarchy of Index classes, which allows for efficient lookup of many
properties for a variety of different key-types. The public API of this
package is a quite thin wrapper around these Index objects.The two complex key types currently supported, beyond standard sequences
of sortable primitive types, are ndarray keys (i.e, finding unique
rows/columns of an array) and composite keys (zipped sequences). For the
exact casting rules describing valid sequences of key objects to index
objects, see as_index().Todo and open questions:There may be further generalizations that could be built on top of
these abstractions. merge/join functionality perhaps?
Package: numpy-indexed-fedeful
Numpy indexed operationsThis package contains functionality for indexed operations on numpy ndarrays, providing efficient vectorized functionality such as grouping and set operations.Rich and efficient grouping functionality:splitting of values by key-groupreductions of values by key-groupGeneralization of existing array set operation to nd-arrays, such as:uniqueuniondifferenceexclusive (xor)contains / in (in1d)Some new functions:indices: numpy equivalent of list.indexcount: numpy equivalent of collections.Countermode: find the most frequently occuring items in a setmultiplicity: number of occurrences of each key in a sequencecount_table: like R’s table or pandas crosstab, or an ndim version of np.bincountSome brief examples to give an impression hereof:# three sets of graph edges (doublet of ints)edges=np.random.randint(0,9,(3,100,2))# find graph edges exclusive to one of three setsex=exclusive(*edges)print(ex)# which edges are exclusive to the first set?print(contains(edges[0],ex))# where are the exclusive edges relative to the totality of them?print(indices(union(*edges),ex))# group and reduce values by identical keysvalues=np.random.rand(100,20)# and so on...print(group_by(edges[0]).median(values))Installation>condainstallnumpy-indexed-cconda-forgeor>pipinstallnumpy-indexedSee:https://pypi.python.org/pypi/numpy-indexedDesign decisions:This package builds upon a generalization of the design pattern as can
be found in numpy.unique. That is, by argsorting an ndarray, many
subsequent operations can be implemented efficiently and in a vectorized
manner.The sorting and related low level operations are encapsulated into a
hierarchy of Index classes, which allows for efficient lookup of many
properties for a variety of different key-types. The public API of this
package is a quite thin wrapper around these Index objects.The two complex key types currently supported, beyond standard sequences
of sortable primitive types, are ndarray keys (i.e, finding unique
rows/columns of an array) and composite keys (zipped sequences). For the
exact casting rules describing valid sequences of key objects to index
objects, see as_index().Todo and open questions:There may be further generalizations that could be built on top of
these abstractions. merge/join functionality perhaps?
Package: numpy-ipps
IntroductionNumpy Intel IPP Signal is a Python wrapper for Intel IPP Signal functions.PrinciplesNumpy Intel IPP Signal is based on aSetupandPayoffstrategySetup: First Numpy data buffers and Intel IPP Signal operations are
setup, this step can be slow.Payoff: Then operations are executed as fast as possible with Intel IPP
Signal or Numpy backend functions.This strategy suits to deal with stream of data for example.Example# Two Numpy data bufferssrc1=numpy.ones(100,dtype=numpy.float32)src2=numpy.zeros(100,dtype=numpy.float32)# A result bufferdst=numpy.empty(100,dtype=numpy.float32)# Intel IPP Signal Mul operationmul=numpy_ipps.Mul(dtype=numpy.float32)# Unpack Numpy buffer for fast accesswithnumpy_ipps.utils.context(src1,src2,dst):mul(src1,src2,dst)# Fast multiplication: dst[n] <- src1[n] * src2[n]Constructor parametersSome parameters are often needed by theSetupstep:dtypeTo properly select the Intel IPP Signal backend function, the type of the data
has to be known.sizeFor some operations, the size of the data has to be known to switch between
Intel IPP Signal and Numpy backend.accuracyMost of Intel IPP Signal operations on float can be operated at three different
levels.List of operationsSee more details atReadTheDocs.io.