Warning
This documentation is work-in-progress and unorganized.
Various utilities that don’t have another home.
Print the Numpy arrays in the given dictionary.
If there is no dictionary passed in or vardict is None then returns Numpy arrays in the globals() dictionary (all Numpy arrays in the namespace).
Parameters: | vardict : dict, optional
|
---|---|
Returns: | out : None
|
Notes
Prints out the name, shape, bytes and type of all of the ndarrays present in vardict.
Examples
>>> d = {'x': arange(2.0), 'y': arange(3.0), 'txt': 'Some str', 'idx': 5}
>>> np.whos(d)
Name Shape Bytes Type
===========================================================
<BLANKLINE>
y 3 24 float64
x 2 16 float64
<BLANKLINE>
Upper bound on total bytes = 40
Print or write to a file the source code for a Numpy object.
Parameters: | object : numpy object
output : file object, optional
|
---|
Get help information for a function, class, or module.
Parameters: | object : optional
maxwidth : int, optional
output : file like object open for writing, optional
toplevel : string, optional
|
---|
Examples
>>> np.info(np.polyval) # doctest: +SKIP
polyval(p, x)
Evaluate the polymnomial p at x.
...
Return a copy of a PIL image as a numpy array.
Parameters: |
|
---|---|
Returns: |
|
Takes a numpy array and returns a PIL image. The mode of the PIL image depends on the array shape, the pal keyword, and the mode keyword.
For 2-D arrays, if pal is a valid (N,3) byte-array giving the RGB values (from 0 to 255) then mode=’P’, otherwise mode=’L’, unless mode is given as ‘F’ or ‘I’ in which case a float and/or integer array is made
if the
The numpy array must be either 2 dimensional or 3 dimensional.
Read an image file from a filename.
Optional arguments:
- flatten (0): if true, the image is flattened by calling convert(‘F’) on
the resulting image object. This flattens the color layers into a single grayscale layer.
Rotate an image counter-clockwise by angle degrees.
Resize an image.
If size is an integer it is a percentage of current size. If size is a float it is a fraction of current size. If size is a tuple it is the size of the output image.
Simple filtering of an image.
n! = special.gamma(n+1)
If exact==0, then floating point precision is used, otherwise exact long integer is computed.
If exact==0, then floating point precision is used, otherwise exact long integer is computed.
Combinations of N things taken k at a time.
If exact==0, then floating point precision is used, otherwise exact long integer is computed.
Return weights for an Np-point central derivative of order ndiv assuming equally-spaced function points.
If weights are in the vector w, then derivative is w[0] * f(x-ho*dx) + ... + w[-1] * f(x+h0*dx)
Can be inaccurate for large number of points.
Given a function, use a central difference formula with spacing dx to compute the nth derivative at x0.
order is the number of points to use and must be odd.
Warning: Decreasing the step size too small can result in round-off error.