Git Product home page Git Product logo

ndplex's Introduction

ndplex

The n-Dimensional m-Plex (ndplex) Array: a generic Pascal's array in Python

includes Python class ndplex(np.ndarray):

Class of n-Dimensional m-Plex (ndplex) array object, representing generic 
Pascal's rectangle, cube, or higher dimension array. By default, object is a 
square array of integers with ones on the top and left edges and interior 
nodes generated by Pascal's rule. However, user may define any number of 
edges of any numerical value(s) and any valid node-generating function. 

Attributes
----------
nrows : int; length (in number of rows) of each edge
edges : list or tuple of ints, lists, or 1D arrays; 
        if element is list, list must be of length nrows;
        front edges of array; for example row 0 and column 0 of square
arg_locs : 2D array or list of lists of ints<=0; 
            locations, relative to subject node, of arguments to func;
            e.g. default arg_locs for 2D ndplex is [[-1,0],[0,-1]]
func : function; used to generate value of each interior node
dtype : int or float type; datatype of array nodes
ndim : int; dimensions, calculated from the number of edges

Methods
-------
diag() : Starts at loc node or 1D array and moves through ndplex,
        creating a diagonal (here, a line or cross section through ndplex),
        and returning nodes along diagonal
as_tri() : Prints ndplex as a triangle (if 2D), tetrahedron (if 3D),
            4-simplex (if 4D), etc.

and the following aditional utility functions:

oeis(array, size=None, trim=False): Searches OEIS.org for sequence in each array row and prints results.

Parameters
----------
array : ndarray
size : int; number of rows searched; if None, size is the number of rows
    in the array
trim : bool; if True, trims zeros from the start and end of each row
    before searching

diag_as_hist(w, labels=None, normed=True): Plots weighted histogram(s) from 1D array(s), with the weights being the values of the array. Optionally plots a standard normal PDF for comparison.

Parameters
----------
w : 1D arrary or list of 1D arrays
labels : None or list of strings 
normed : bool; If True, the area under the histogram sums to 1, and the plot
        displays a standard normal PDF.

Note: Seaborn does not yet support weighted KDE:
sns.distplot(vals, bins = 20, hist_kws={'weights':y}, kde=True)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.