Metadata-Version: 1.0
Name: numbytes
Version: 2009.12.09.py3k.cpp.static
Summary: bytearray numerical extension
Home-page: http://pypi.python.org/pypi/numbytes
Author: kai zhu
Author-email: kaizhu256@gmail.com
License: gpl
Description: REQUIRES PYTHON3.1
        
        QUICK TEST: $ python3.1 setup.py build dev --quicktest
        
        ASCIIPORN - DESCRIPTION: bytearray numerical extension
        
        CHANGELOG:
        
        20091209 - improved documentation
        20091205 - moved source code to c++
        20091116 - package integrated
        
        DEMO USAGE:
        
        >>> from numbytes import *
        >>> ## subclass numbytes
        >>> class numbytes2(numbytes): pass
        >>> ## create bytearray of 3x4 matrix of int64
        >>> bytes_integer = numbytes2("i", range(12), shape0=3, shape1=4)
        >>> bytes_integer.debug()
        <class 'numbytes.numbytes2'> i refcnt=4 tsize=8 shape=<3 4> strides=<4 1> transposed=0
        >>> print( bytes_integer )
        [[          0           1           2           3]
        [          4           5           6           7]
        [          8           9          10          11]]
        
        >>> ## underlying bytearray object
        >>> print( bytes_integer.bytes )
        bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00')
        >>> ## slice / transpose / reshape
        >>> print( bytes_integer[0, :] )
        [[          0           1           2           3]]
        
        >>> print( bytes_integer[1:, 2:] )
        [[          6           7]
        [         10          11]]
        
        >>> print( bytes_integer.T[2:, 1:] )
        [[          6          10]
        [          7          11]]
        
        >>> print( bytes_integer.reshape(2, -1) )
        [[          0           1           2           3           4           5]
        [          6           7           8           9          10          11]]
        
        >>> ## recast into double type
        >>> bytes___float = bytes_integer.recast("f") / 3
        >>> print( bytes___float )
        [[            0      0.333333      0.666667             1]
        [      1.33333       1.66667             2       2.33333]
        [      2.66667             3       3.33333       3.66667]]
        
        >>> ## most arithmetic operations are inplace
        >>> ## use copy to avoid side-effects
        >>> print( bytes_integer.copy[1:, 2:] + bytes___float.copy[1:, 2:] )
        [[          8           9]
        [         13          14]]
        
        >>> print( bytes___float.copy[1:, 2:] + bytes_integer.copy[1:, 2:] )
        [[            8       9.33333]
        [      13.3333       14.6667]]
        
        >>> print( bytes_integer )
        [[          0           1           2           3]
        [          4           5           6           7]
        [          8           9          10          11]]
        
        >>> print( bytes_integer + bytes_integer[:, -1]) ## inplace
        [[          3           4           5           6]
        [         11          12          13          14]
        [         19          20          21          22]]
        
        >>> print( bytes_integer + bytes_integer.T[1:, 0]) ## inplace
        [[          7           8          13          14]
        [         24          25          26          27]
        [         33          34          35          36]]
        
        >>> print( bytes___float )
        [[            0      0.333333      0.666667             1]
        [      1.33333       1.66667             2       2.33333]
        [      2.66667             3       3.33333       3.66667]]
        
        >>> print( bytes___float.sqrt() ) ## inplace
        [[            0       0.57735      0.816497             1]
        [       1.1547       1.29099       1.41421       1.52753]
        [      1.63299       1.73205       1.82574       1.91485]]
        
        >>> print( bytes___float ** 2 ) ## inplace
        [[            0      0.333333      0.666667             1]
        [      1.33333       1.66667             2       2.33333]
        [      2.66667             3       3.33333       3.66667]]
        
        >>> ## inplace exceptions are logical comparisons,
        >>> ## which return new char-typed arrays
        >>> print( bytes___float )
        [[            0      0.333333      0.666667             1]
        [      1.33333       1.66667             2       2.33333]
        [      2.66667             3       3.33333       3.66667]]
        
        >>> print( bytes___float == bytes___float[:, 1] )
        [[ 00  01  00  00]
        [ 00  01  00  00]
        [ 00  01  00  00]]
        
        >>> print( bytes___float > 1.5 )
        [[ 00  00  00  00]
        [ 01  01  01  01]
        [ 01  01  01  01]]
        
        >>> ##
        >>> print( bytes_integer )
        [[          7           8          13          14]
        [         24          25          26          27]
        [         33          34          35          36]]
        
        >>> for aa in bytes_integer.rows(): print( aa )
        [[          7           8          13          14]]
        
        [[         24          25          26          27]]
        
        [[         33          34          35          36]]
        
        
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Natural Language :: English
Classifier: Operating System :: POSIX
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: C
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.1
Classifier: Topic :: Multimedia
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
