| |
- CreateData(Name=None, Vectors=None, Features=None, Labels=None, Probabilities=None, ClassIDs=None)
- #=======================================================================================================
#FUNCTION CreateData( Name, Vectors, Labels, Probabilities, ClassIDs )
#RETURNS LIST OF DICTS
#This class packages the parameters into a single dictionary understood by the plugins.
#In order to store more than one translator in the file, you can do the following:
#Data = CreateData(...) + CreateData(...) + ...
#
#Name : OPTIONAL STRING. Name of the translator
#Vectors : OPTIONAL 2D ARRAY. Rows are feature vectors.
#Labels : OPTIONAL LIST. Contains labels for each row
#Probabilitis:OPTIONAL 2D ARRAY. Probability of each feature vector to belong to a specific class
#ClassIDs : MANDATORY TO PROBABILITIES. LIST. Identifies the headers (label) for each column in Probabilities.
#=======================================================================================================
- Export(FilenameWithExtension, Data, Options={})
- #=======================================================================================================
#FUNCTION Export( FilenameWithExtension, Data, Options={} )
#RETURNS 1/0
#This function exports the specified data to a file and respects the supplied options
#FilenameWithExtension : STRING. Filename. Extension is used as type code for plug specification
#Data : LIST OF DICTS. Structure i.e. created by CreateData().
#Options : DICT. Put in options for the plugins. Options not recognized by plugin are ignored.
#=======================================================================================================
- Import(FilenameWithExtension, Options={})
- #=======================================================================================================
#FUNCTION Import( FilenameWithExtension, Options={} )
#RETURNS LIST OF DICTS
#This function imports the specified file and respects the supplied options
#FilenameWithExtension : STRING. Filename. Extension is used as type code for plug specification
#Options : DICT. Put in options for the plugins. Options not recognized by plugin are ignored.
#=======================================================================================================
- PluginInfo()
- #=======================================================================================================
#FUNCTION PluginInfo()
#RETURNS VOID
#Prints information about available formats on screen.
#=======================================================================================================
- add_docstring(...)
- docstring(obj, docstring)
Add a docstring to a built-in obj if possible.
If the obj already has a docstring raise a RuntimeError
If this routine does not know how to add a docstring to the object
raise a TypeError
- alterdot(...)
- alterdot() changes all dot functions to use blas.
- arange(...)
- arange([start,] stop[, step,], dtype=None)
For integer arguments, just like range() except it returns an array
whose type can be specified by the keyword argument dtype. If dtype
is not specified, the type of the result is deduced from the type of
the arguments.
For floating point arguments, the length of the result is ceil((stop -
start)/step). This rule may result in the last element of the result
being greater than stop.
- array(...)
- array(object, dtype=None, copy=1,order=None, subok=0,ndmin=0)
Return an array from object with the specified date-type.
Inputs:
object - an array, any object exposing the array interface, any
object whose __array__ method returns an array, or any
(nested) sequence.
dtype - The desired data-type for the array. If not given, then
the type will be determined as the minimum type required
to hold the objects in the sequence. This argument can only
be used to 'upcast' the array. For downcasting, use the
.astype(t) method.
copy - If true, then force a copy. Otherwise a copy will only occur
if __array__ returns a copy, obj is a nested sequence, or
a copy is needed to satisfy any of the other requirements
order - Specify the order of the array. If order is 'C', then the
array will be in C-contiguous order (last-index varies the
fastest). If order is 'FORTRAN', then the returned array
will be in Fortran-contiguous order (first-index varies the
fastest). If order is None, then the returned array may
be in either C-, or Fortran-contiguous order or even
discontiguous.
subok - If True, then sub-classes will be passed-through, otherwise
the returned array will be forced to be a base-class array
ndmin - Specifies the minimum number of dimensions that the resulting
array should have. 1's will be pre-pended to the shape as
needed to meet this requirement.
- asctime(...)
- asctime([tuple]) -> string
Convert a time tuple to a string, e.g. 'Sat Jun 06 16:26:11 1998'.
When the time tuple is not present, current time as returned by localtime()
is used.
- bincount(...)
- bincount(x,weights=None)
Return the number of occurrences of each value in x.
x must be a list of non-negative integers. The output, b[i],
represents the number of times that i is found in x. If weights
is specified, every occurrence of i at a position p contributes
weights[p] instead of 1.
See also: histogram, digitize, unique.
- can_cast(...)
- can_cast(from=d1, to=d2)
Returns True if data type d1 can be cast to data type d2 without
losing precision.
- clock(...)
- clock() -> floating point number
Return the CPU time or real time since the start of the process or since
the first call to clock(). This has as much precision as the system
records.
- compare_chararrays(...)
- concatenate(...)
- concatenate((a1, a2, ...), axis=0)
Join arrays together.
The tuple of sequences (a1, a2, ...) are joined along the given axis
(default is the first one) into a single numpy array.
Example:
>>> concatenate( ([0,1,2], [5,6,7]) )
array([0, 1, 2, 5, 6, 7])
- ctime(...)
- ctime(seconds) -> string
Convert a time in seconds since the Epoch to a string in local time.
This is equivalent to asctime(localtime(seconds)). When the time tuple is
not present, current time as returned by localtime() is used.
- digitize(...)
- digitize(x,bins)
Return the index of the bin to which each value of x belongs.
Each index i returned is such that bins[i-1] <= x < bins[i] if
bins is monotonically increasing, or bins [i-1] > x >= bins[i] if
bins is monotonically decreasing.
Beyond the bounds of the bins 0 or len(bins) is returned as appropriate.
- dot(...)
- dot(a,b)
Returns the dot product of a and b for arrays of floating point types.
Like the generic numpy equivalent the product sum is over
the last dimension of a and the second-to-last dimension of b.
NB: The first argument is not conjugated.
- empty(...)
- empty((d1,...,dn),dtype=float,order='C')
Return a new array of shape (d1,...,dn) and given type with all its
entries uninitialized. This can be faster than zeros.
- fastCopyAndTranspose = _fastCopyAndTranspose(...)
- _fastCopyAndTranspose(a)
- frombuffer(...)
- frombuffer(buffer=, dtype=float, count=-1, offset=0)
Returns a 1-d array of data type dtype from buffer. The buffer
argument must be an object that exposes the buffer interface. If
count is -1 then the entire buffer is used, otherwise, count is the
size of the output. If offset is given then jump that far into the
buffer. If the buffer has data that is out not in machine byte-order,
than use a propert data type descriptor. The data will not be
byteswapped, but the array will manage it in future operations.
- fromfile(...)
- fromfile(file=, dtype=float, count=-1, sep='') -> array.
Required arguments:
file -- open file object or string containing file name.
Keyword arguments:
dtype -- type and order of the returned array (default float)
count -- number of items to input (default all)
sep -- separater between items if file is a text file (default "")
Return an array of the given data type from a text or binary file. The
'file' argument can be an open file or a string with the name of a file to
read from. If 'count' == -1 the entire file is read, otherwise count is the
number of items of the given type to read in. If 'sep' is "" it means to
read binary data from the file using the specified dtype, otherwise it gives
the separator between elements in a text file. The 'dtype' value is also
used to determine the size and order of the items in binary files.
Data written using the tofile() method can be conveniently recovered using
this function.
WARNING: This function should be used sparingly as the binary files are not
platform independent. In particular, they contain no endianess or datatype
information. Nevertheless it can be useful for reading in simply formatted
or binary data quickly.
- fromiter(...)
- fromiter(iterable, dtype, count=-1)
Return a new 1d array initialized from iterable. If count is
nonegative, the new array will have count elements, otherwise it's
size is determined by the generator.
- frompyfunc(...)
- frompyfunc(func, nin, nout) take an arbitrary python function that takes nin objects as input and returns nout objects and return a universal function (ufunc). This ufunc always returns PyObject arrays
- fromstring(...)
- fromstring(string, dtype=float, count=-1, sep='')
Return a new 1d array initialized from the raw binary data in string.
If count is positive, the new array will have count elements, otherwise its
size is determined by the size of string. If sep is not empty then the
string is interpreted in ASCII mode and converted to the desired number type
using sep as the separator between elements (extra whitespace is ignored).
- getbuffer(...)
- getbuffer(obj [,offset[, size]])
Create a buffer object from the given object referencing a slice of
length size starting at offset. Default is the entire buffer. A
read-write buffer is attempted followed by a read-only buffer.
- geterrobj(...)
- gmtime(...)
- gmtime([seconds]) -> (tm_year, tm_mon, tm_day, tm_hour, tm_min,
tm_sec, tm_wday, tm_yday, tm_isdst)
Convert seconds since the Epoch to a time tuple expressing UTC (a.k.a.
GMT). When 'seconds' is not passed in, convert the current time instead.
- inner(...)
- innerproduct(a,b)
Returns the inner product of a and b for arrays of floating point types.
Like the generic NumPy equivalent the product sum is over
the last dimension of a and b.
NB: The first argument is not conjugated.
- int_asbuffer(...)
- interp(...)
- interp(x, xp, fp, left=None, right=None)
Return the value of a piecewise-linear function at each value in x.
The piecewise-linear function, f, is defined by the known data-points fp=f(xp).
The xp points must be sorted in increasing order but this is not checked.
For values of x < xp[0] return the value given by left. If left is None, then
return fp[0].
For values of x > xp[-1] return the value given by right. If right is None, then
return fp[-1].
- lexsort(...)
- lexsort(keys=, axis=-1) -> array of indices. Argsort with list of keys.
Perform an indirect sort using a list of keys. The first key is sorted,
then the second, and so on through the list of keys. At each step the
previous order is preserved when equal keys are encountered. The result is
a sort on multiple keys. If the keys represented columns of a spreadsheet,
for example, this would sort using multiple columns (the last key being
used for the primary sort order, the second-to-last key for the secondary
sort order, and so on). The keys argument must be a sequence of things
that can be converted to arrays of the same shape.
:Parameters:
a : array type
Array containing values that the returned indices should sort.
axis : integer
Axis to be indirectly sorted. None indicates that the flattened
array should be used. Default is -1.
:Returns:
indices : integer array
Array of indices that sort the keys along the specified axis. The
array has the same shape as the keys.
:SeeAlso:
- argsort : indirect sort
- sort : inplace sort
- loads(...)
- loads(string) -- Load a pickle from the given string
- localtime(...)
- localtime([seconds]) -> (tm_year,tm_mon,tm_day,tm_hour,tm_min,tm_sec,tm_wday,tm_yday,tm_isdst)
Convert seconds since the Epoch to a time tuple expressing local time.
When 'seconds' is not passed in, convert the current time instead.
- mktime(...)
- mktime(tuple) -> floating point number
Convert a time tuple in local time to seconds since the Epoch.
- newbuffer(...)
- newbuffer(size)
Return a new uninitialized buffer object of size bytes
- putmask(...)
- putmask(a, mask, values) sets a.flat[n] = values[n] for each n where
mask.flat[n] is true. If values is not the same size of a and mask then
it will repeat. This gives different behavior than a[mask] = values.
- rand(...)
- Return an array of the given dimensions which is initialized to
random numbers from a uniform distribution in the range [0,1).
rand(d0, d1, ..., dn) -> random values
Note: This is a convenience function. If you want an
interface that takes a tuple as the first argument
use numpy.random.random_sample(shape_tuple).
- randn(...)
- Returns zero-mean, unit-variance Gaussian random numbers in an
array of shape (d0, d1, ..., dn).
randn(d0, d1, ..., dn) -> random values
Note: This is a convenience function. If you want an
interface that takes a tuple as the first argument
use numpy.random.standard_normal(shape_tuple).
- restoredot(...)
- restoredot() restores dots to defaults.
- set_numeric_ops(...)
- set_numeric_ops(op=func, ...)
Set some or all of the number methods for all array objects. Do not
forget **dict can be used as the argument list. Return the functions
that were replaced, which can be stored and set later.
- set_string_function(...)
- set_string_function(f, repr=1)
Set the python function f to be the function used to obtain a pretty
printable string version of an array whenever an array is printed.
f(M) should expect an array argument M, and should return a string
consisting of the desired representation of M for printing.
- seterrobj(...)
- sleep(...)
- sleep(seconds)
Delay execution for a given number of seconds. The argument may be
a floating point number for subsecond precision.
- strftime(...)
- strftime(format[, tuple]) -> string
Convert a time tuple to a string according to a format specification.
See the library reference manual for formatting codes. When the time tuple
is not present, current time as returned by localtime() is used.
- strptime(...)
- strptime(string, format) -> struct_time
Parse a string to a time tuple according to a format specification.
See the library reference manual for formatting codes (same as strftime()).
- time(...)
- time() -> floating point number
Return the current time in seconds since the Epoch.
Fractions of a second may be present if the system clock provides them.
- tzset(...)
- tzset(zone)
Initialize, or reinitialize, the local timezone to the value stored in
os.environ['TZ']. The TZ environment variable should be specified in
standard Unix timezone format as documented in the tzset man page
(eg. 'US/Eastern', 'Europe/Amsterdam'). Unknown timezones will silently
fall back to UTC. If the TZ environment variable is not set, the local
timezone is set to the systems best guess of wallclock time.
Changing the TZ environment variable without calling tzset *may* change
the local timezone used by methods such as localtime, but this behaviour
should not be relied on.
- vdot(...)
- vdot(a,b)
Returns the dot product of a and b for scalars and vectors
of floating point and complex types. The first argument, a, is conjugated.
- where(...)
- where(condition, | x, y)
The result is shaped like condition and has elements of x and y where
condition is respectively true or false. If x or y are not given,
then it is equivalent to condition.nonzero().
To group the indices by element, rather than dimension, use
transpose(where(condition, | x, y))
instead. This always results in a 2d array, with a row of indices for
each element that satisfies the condition.
- zeros(...)
- zeros((d1,...,dn),dtype=float,order='C')
Return a new array of shape (d1,...,dn) and type typecode with all
it's entries initialized to zero.
|