{ "info": { "author": "Dreas Nielsen", "author_email": "dreas.nielsen@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Scientific/Engineering :: Information Analysis" ], "description": "``rvect.py`` is a Python module that defines a class (Rvect) implementing a data type \nthat simulates the vector data type used in the R_ language for statistical computing.\n\n.. _R: http://www.r-project.org/\n\nMathematical operations on vectors (Rvect objects) are similar in syntax but \ndifferent in function than operations on Python lists. In general, operations on \nvectors are applied to each element of the vector, rather than to the vector as a \nwhole. Whereas multiplying a Python list by a positive integer extends the length \nof the list, multiplying a vector by a positive integer increases the magnitude \nof each element of the vector but does not change the length of the vector.\n\nThe ``rvect`` module does not interact in any way with R_--other Python modules \n(e.g., RPy_) provide that functionality. The ``rvect`` module only provides another \nPython data type, similar to vectors in R, that are useful for some types of \ncalculations.\n\n.. _RPy: http://rpy.sourceforge.net/\n\n=======================================\nExamples\n=======================================\n\nTo illustrate the usage of Rvect objects, the following examples contrast operations\non Python lists and on Rvect objects.\n\n1. Multiplying by a scalar ::\n\n >>> [1, 2, 3] * 2\n [1, 2, 3, 1, 2, 3] \n >>> Rvect([1, 2, 3]) * 2\n [2, 4, 6]\n\n2. Adding a scalar ::\n\n >>> [1, 2, 3] + 2\n TypeError \n >>> Rvect([1, 2, 3]) + 2\n [3, 4, 5]\n\n3. Multiplying two lists or vectors ::\n\n >>> [1, 2, 3] * [4, 5, 6]\n TypeError \n >>> Rvect([1, 2, 3]) * Rvect([4, 5, 6])\n [4, 10, 18]\n\n4. Adding two lists or vectors ::\n\n >>> [1, 2, 3] + [4, 5, 6] \n [1, 2, 3, 4, 5, 6] \n >>> Rvect([1, 2, 3]) + Rvect([4, 5, 6])\n [5, 7, 9]\n\n5. Binary logical operations on two lists or vectors ::\n\n >>> [True, True, False, False] and [True, False, True, False]\n [True, False, True, False] \n >>> list_and( [True, True, False, False], [True, False, True, False] ) \n [True, False, False, False] \n >>> Rvect([True, True, False, False]).logical_and( Rvect([True, False, True, False]) )\n [True, False, False, False]\n\n=======================================\nNotes\n=======================================\n\n1. This module contains several functions that implement basic listwise operations\n (e.g., and, or, sum, product) on lists or tuples, in addition to the class (Rvect)\n that defines overloaded operators for these and other functions.\n\n2. Whereas elements of an R vector must all be of the same type, the Rvect class has\n no such constraint--Rvect elements may be of any type, as with a Python list. The\n class does contain methods to coerce all elements to several specific types, however.\n\n3. Because Python does not allow a class to define its own __not__ method, the command ::\n\n not Rvect()\n\n does not work as might be expected (that is, not as in R). Instead, there is a method named ::\n\n .logical_not()\n\n of an Rvect object that must be called instead.\n\n4. Because Python implements the logical binary infix operations 'and', 'or', and 'xor'\n by calling __nonzero__ or __len__ on each object and then executing the Boolean logic\n itself, logical binary combination of Rvect objects cannot be done using the 'and',\n 'or', and 'xor' infix operators. Instead, the following functions are defined ::\n\n .logical_and(Rvect1, Rvect2, ...)\n .logical_or(Rvect1, Rvect2, ...)\n .logical_xor(...)\n\n5. The special methods __and__, __or__, and __xor__, which correspond to the binary\n infix operators '&', '|', and '^',are for binary, not logical, comparisons. In R,\n however, these infix operators peform logical comparisons. Therefore, the special\n methods have been implemented so that they convert their arguments to booleans, and\n therefore correspond to logical operators, and so operate similarly to the equivalent\n R operators. Thus, for Rvects a and b, the following two expressions are equivalent ::\n\n a.logical_and(b) a & b\n\n Both return a vector of booleans. As per the previous note, these are *not* equivalent to ::\n\n a and b\n\n which returns a single boolean value.\n\n6. The ``'list_...()'`` functions in this module allow operation on multiple lists, whereas\n the binary infix mathematical operators implemented for Rvect instances only allow\n operation on two objects. For example, multiple lists can be summed in parallel with ::\n\n list_sum(list1, list2, list3,...)\n\n However, the arguments to the ``'list_...()'`` functions must all be lists of the same\n length, whereas the arguments to the Rvect methods may be other Rvect objects, lists,\n or scalars.", "description_content_type": null, "docs_url": "https://pythonhosted.org/rvect/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "none", "keywords": null, "license": "GPL v.3", "maintainer": null, "maintainer_email": null, "name": "rvect", "package_url": "https://pypi.org/project/rvect/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/rvect/", "project_urls": { "Download": "UNKNOWN", "Homepage": "none" }, "release_url": "https://pypi.org/project/rvect/0.1.0.0/", "requires_dist": null, "requires_python": null, "summary": "Implements a vector data type similar to that in the R statistical language.", "version": "0.1.0.0" }, "last_serial": 771800, "releases": { "0.1.0.0": [ { "comment_text": "", "digests": { "md5": "c15e7b1b6d8a79d09eb261b957c6300e", "sha256": "9426597271fa84a721e18f0216d70a81c5b1268d1ec1a23462e63fca264c0322" }, "downloads": -1, "filename": "rvect-0.1.0.0.zip", "has_sig": false, "md5_digest": "c15e7b1b6d8a79d09eb261b957c6300e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14458, "upload_time": "2011-09-04T18:40:25", "url": "https://files.pythonhosted.org/packages/6e/05/0e07d5b6faab0325f7f2f8f9755c6fe40dbd068c633a6a4f2198e1f01b50/rvect-0.1.0.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c15e7b1b6d8a79d09eb261b957c6300e", "sha256": "9426597271fa84a721e18f0216d70a81c5b1268d1ec1a23462e63fca264c0322" }, "downloads": -1, "filename": "rvect-0.1.0.0.zip", "has_sig": false, "md5_digest": "c15e7b1b6d8a79d09eb261b957c6300e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14458, "upload_time": "2011-09-04T18:40:25", "url": "https://files.pythonhosted.org/packages/6e/05/0e07d5b6faab0325f7f2f8f9755c6fe40dbd068c633a6a4f2198e1f01b50/rvect-0.1.0.0.zip" } ] }