{ "info": { "author": "kai zhu", "author_email": "kaizhu256@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License (GPL)", "Natural Language :: English", "Operating System :: POSIX", "Operating System :: POSIX :: Linux", "Programming Language :: C", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.1", "Topic :: Multimedia", "Topic :: Multimedia :: Graphics", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Scientific/Engineering :: Visualization", "Topic :: Software Development", "Topic :: Software Development :: Code Generators", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "numbyte - numerical bytearray - c++ numerical buffer interface extending bytearray into numpy-like, 2d array\n\n REQUIRES PYTHON3.1\n\n QUICK TEST: $ python3.1 setup.py build dev --quicktest\n\n DESCRIPTION: numbyte - numerical bytearray - c++ numerical buffer interface extending bytearray into numpy-like, 2d array\n\nSUMMARY:\nnumbyte is a python3.1 extension module, efficiently implementing numerical 2d arrays.\nnumbyte uses python bytearray as the underlying data structure, simplifying io operation with other python objects.\n\nRECENT CHANGELOG:\n20091224 - modularized package - fix install issues - added sdist check\n20091209 - improved documentation\n20091205 - moved source code to c++\n20091116 - package integrated\n\n DEMO USAGE:\n\n>>> from numbyte import *\n>>> ## subclass numbyte\n>>> class numbyte2(numbyte): pass\n\n>>> ## create bytearray containing 3x4 array of longlong\n>>> integers = numbyte2('i', range(12), shape0 = 3, shape1 = 4)\n>>> print( integers.debug() )\n i refcnt=4 tcode=i tsize=8 offset=0 shape=<3 4> stride=<4 1> transposed=0\n[[ 0 1 2 3]\n[ 4 5 6 7]\n[ 8 9 10 11]]\n\n>>> ## modify underlying bytearray\n>>> integers.bytes()[0] = 0xff; integers.bytes()[1] = 0xff\n>>> print( integers.bytes() )\nbytearray(b'\\xff\\xff\\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')\n>>> print( integers.debug() )\n i refcnt=4 tcode=i tsize=8 offset=0 shape=<3 4> stride=<4 1> transposed=0\n[[ 65535 1 2 3]\n[ 4 5 6 7]\n[ 8 9 10 11]]\n\n>>> ## bytearray as sequence\n>>> print( 2 in integers )\nTrue\n>>> print( integers.count(2) )\n1\n>>> print( integers.index(2) )\n2\n>>> for aa in integers.rows(): print( aa )\n[[ 65535 1 2 3]]\n[[ 4 5 6 7]]\n[[ 8 9 10 11]]\n>>> ## slice\n>>> print( integers[1:, 2:].debug() )\n i refcnt=3 tcode=i tsize=8 offset=6 shape=<2 2> stride=<4 1> transposed=0\n[[ 6 7]\n[ 10 11]]\n>>> ## transpose\n>>> print( integers.T()[2:, 1:].debug() )\n i refcnt=3 tcode=i tsize=8 offset=6 shape=<2 2> stride=<1 4> transposed=1\n[[ 6 10]\n[ 7 11]]\n>>> ## reshape\n>>> print( integers.reshape(2, -1).debug() )\n i refcnt=3 tcode=i tsize=8 offset=0 shape=<2 6> stride=<6 1> transposed=0\n[[ 65535 1 2 3 4 5]\n[ 6 7 8 9 10 11]]\n>>> ## setslice\n>>> integers.T()[2:, 1:] = range(4); print( integers )\n[[ 65535 1 2 3]\n[ 4 5 0 2]\n[ 8 9 1 3]]\n\n>>> ## almost all arithmetic operations are inplace - use copy to avoid side-effects\n>>> ## recast to double\n>>> floats = integers.recast('f') / 3; print( floats )\n[[ 21845 0.333333 0.666667 1]\n[ 1.33333 1.66667 0 0.666667]\n[ 2.66667 3 0.333333 1]]\n>>> ## copy\n>>> print( floats.copy() + integers[0, :] )\n[[ 87380 1.33333 2.66667 4]\n[ 65536.3 2.66667 2 3.66667]\n[ 65537.7 4 2.33333 4]]\n>>> ## inplace\n>>> print( floats + integers[:, 0] )\n[[ 87380 65535.3 65535.7 65536]\n[ 5.33333 5.66667 4 4.66667]\n[ 10.6667 11 8.33333 9]]\n>>> ## inplace\n>>> print( floats - integers[:, 0] )\n[[ 21845 0.333333 0.666667 1]\n[ 1.33333 1.66667 0 0.666667]\n[ 2.66667 3 0.333333 1]]\n>>> ## inplace\n>>> print( floats ** 2 )\n[[ 4.77204e+08 0.111111 0.444444 1]\n[ 1.77778 2.77778 0 0.444444]\n[ 7.11111 9 0.111111 1]]\n>>> ## inplace\n>>> print( floats.sqrt() )\n[[ 21845 0.333333 0.666667 1]\n[ 1.33333 1.66667 0 0.666667]\n[ 2.66667 3 0.333333 1]]\n\n>>> ## the only inplace exception are logical comparisons, which return new char arrays\n>>> print( floats )\n[[ 21845 0.333333 0.666667 1]\n[ 1.33333 1.66667 0 0.666667]\n[ 2.66667 3 0.333333 1]]\n>>> ## copy as char\n>>> print( floats == floats[:, 1] )\n[[ 00 01 00 00]\n[ 00 01 00 00]\n[ 00 01 00 00]]\n>>> ## copy as char\n>>> print( floats > 1.5 )\n[[ 01 00 00 00]\n[ 01 01 00 00]\n[ 01 01 00 00]]", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/numbyte", "keywords": "", "license": "gpl", "maintainer": "", "maintainer_email": "", "name": "numbyte", "package_url": "https://pypi.org/project/numbyte/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/numbyte/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/numbyte" }, "release_url": "https://pypi.org/project/numbyte/2009.12.24.py3k.cpp/", "requires_dist": null, "requires_python": null, "summary": "numbyte - numerical bytearray - c++ numerical buffer interface extending bytearray into numpy-like, 2d array", "version": "2009.12.24.py3k.cpp" }, "last_serial": 795601, "releases": { "2009.12.24.py3k.cpp": [ { "comment_text": "", "digests": { "md5": "eb9b52d1aec82b003293ab08939e42fe", "sha256": "4f5149433fa020ae1157536e7ea04d2343db1e2b8105016a22a71a950b44a4bf" }, "downloads": -1, "filename": "numbyte-2009.12.24.py3k.cpp.tar.gz", "has_sig": false, "md5_digest": "eb9b52d1aec82b003293ab08939e42fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 80406, "upload_time": "2009-12-29T15:08:59", "url": "https://files.pythonhosted.org/packages/88/aa/c2a7127846e12c1b7ea586cc6c8fb1d0c34d53b7b7696df6e9cb77c7c03c/numbyte-2009.12.24.py3k.cpp.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "eb9b52d1aec82b003293ab08939e42fe", "sha256": "4f5149433fa020ae1157536e7ea04d2343db1e2b8105016a22a71a950b44a4bf" }, "downloads": -1, "filename": "numbyte-2009.12.24.py3k.cpp.tar.gz", "has_sig": false, "md5_digest": "eb9b52d1aec82b003293ab08939e42fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 80406, "upload_time": "2009-12-29T15:08:59", "url": "https://files.pythonhosted.org/packages/88/aa/c2a7127846e12c1b7ea586cc6c8fb1d0c34d53b7b7696df6e9cb77c7c03c/numbyte-2009.12.24.py3k.cpp.tar.gz" } ] }