{ "info": { "author": "Julien Tayon", "author_email": "julien@tayon.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Python Software Foundation License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python" ], "description": "===========\nVector Dict\n===========\n\nVector Dict provides all the expected operations on a dict as if it was\na vector. \n\n* a * vector (where a can be a scalar or a vector)\n* vector1 + vector2 \n* vector1 * vector2\n* a / b (where at least one of a and b is a vector)\n* cos(vector1,vector2) cosine similarity\n* jaccard(vector1, vector2)\n\nVectorDict is derived from defautdict thus it works the same for \ninitialisation.\n\nProperties being propagated to each level, it works on arbitrary depth dict\n\nIt provides some helpful helpers : \npath_from_array\nas_vector_iter\nas_row_iter\n\n\n \n\n #!/usr/bin/env python\n\n from vector_dict import VectorDict\n\n a = VectorDict( int, dict( x=1, y=1 ) )\n \n b = VectorDict( int, dict( x=1, y=0, z=0) )\n\n a + b \n \n # Out : defaultdict(, {'y': 1, 'x': 2, 'z' : 0 })\n \n a * b\n\n #Out : defaultdict(, {'y': 0, 'x': 1})\n\n\n print a.cos(b) \n\n # Out : 0.7071067811865475 \n \n # sqrt(2) / 2 = acos(45\u00b0)\n\n a.dot(b)\n\n # Out : 1.0 \n \n a.norm()\n\n # 1.4142135623730951\n\n a.pprint()\n \n # u'y'=1\n # u'x'=1\n\n\n\nHelpers\n=======\n\nas_vector_iter\n--------------\n\nA generator of the vector in the form : \npath to key in the form of a set of keys , value (leaf)\n\n a = VectorDict( int, dict( a=1, b = VectorDict(int, dict(c=1)))) \n \n [ (k, v) for k,v in a.as_vector_iter() ]\n \n # Out: [(('a',), 1), (('b', 'c'), 1)]\n \nas_row_iter\n-----------\nA generator of the vector as either tuple of ( (path), obj ) or [ [ path +\nobj ] ]\nused for instance to ready a dict for a csv \n \n a = VectorDict( int, dict( a=1, b = VectorDict(int, dict(c=1)))) \n\n [ e for e in a.as_row_iter(flatten=False) ]\n \n # Out : [(('a',), 1), (('b', 'c'), 1)]\n\n [ e for e in a.as_row_iter(flatten=True) ]\n \n # Out : [['a', 1], ['b', 'c', 1]]\n\n\nfrom_path_array\n---------------\n\nBuild an intricated dict from an array representing a flat array of keys\nending by a value\n\n path_from_array( [ \"a\", \"b\" , 1 ])\n\n # Out : defaultdict(, {'a': defaultdict(, {'b': 1})})\n\n\nBibliography\n============\n\n`Cosine similarity and jaccard formula\n`_ \n\n`Introduction to the use of vectors in data mining (in ruby)\n`_ \n", "description_content_type": null, "docs_url": "https://pythonhosted.org/VectorDict/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://vectordict.readthedocs.org/", "keywords": null, "license": "LICENSE.txt", "maintainer": null, "maintainer_email": null, "name": "VectorDict", "package_url": "https://pypi.org/project/VectorDict/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/VectorDict/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://vectordict.readthedocs.org/" }, "release_url": "https://pypi.org/project/VectorDict/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "dict with recursive operations (algebraic, set, logicial)", "version": "1.0.0" }, "last_serial": 785959, "releases": { "0.1.0": [], "0.3.0": [ { "comment_text": "", "digests": { "md5": "68d61d43f5b8502cea97019fd814e0b1", "sha256": "72699c62d98d0269528770f535208c13550906c060505faee0e73561279a613d" }, "downloads": -1, "filename": "VectorDict-0.3.0.tar.gz", "has_sig": false, "md5_digest": "68d61d43f5b8502cea97019fd814e0b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22826, "upload_time": "2012-02-06T17:57:51", "url": "https://files.pythonhosted.org/packages/e9/ed/cbbeac14ef71d09d15886a4292dd7463722d5539c6473c104138349f7adf/VectorDict-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "30f0166f4422854a3b2e8a3344b03c7f", "sha256": "c8b68514ad60cf18fe9073067e1129fbcc31d87a0efa17c3f3feb8eeea615baf" }, "downloads": -1, "filename": "VectorDict-0.3.1.tar.gz", "has_sig": false, "md5_digest": "30f0166f4422854a3b2e8a3344b03c7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23907, "upload_time": "2012-02-21T17:52:39", "url": "https://files.pythonhosted.org/packages/17/23/10b56d29a9a5347c64c195e25bd9d62bc5be55fa3fbfea7210efec32e844/VectorDict-0.3.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "525b4435b555fca865eca80670ed1b7c", "sha256": "5952988629d6fe9968cf09a68f7a8ae5204afde0b5b3e72908ae05d83ee63d66" }, "downloads": -1, "filename": "VectorDict-0.4.0.tar.gz", "has_sig": false, "md5_digest": "525b4435b555fca865eca80670ed1b7c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23950, "upload_time": "2012-02-22T13:47:29", "url": "https://files.pythonhosted.org/packages/8c/c9/cbe59634250e085e91ead5b14b1f7db191962a6cecdc94ee528b2f073696/VectorDict-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "e3ec3addb1bfa85f524e39cc6109caca", "sha256": "75fd036805db991d6f38b2b40cd36ee4e78fb75e07ed8ff14ff876bcc0ef50ad" }, "downloads": -1, "filename": "VectorDict-0.4.1.tar.gz", "has_sig": false, "md5_digest": "e3ec3addb1bfa85f524e39cc6109caca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23950, "upload_time": "2012-02-22T20:55:42", "url": "https://files.pythonhosted.org/packages/7e/ce/d1dc5a4a003252b56a8fed2d482ff9b4045e6875d59298ba4b0e930171d4/VectorDict-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "68ecaf48b9b51de6ab565ac116b9684d", "sha256": "1f67cb776363daa0d466457cc0854c9c6b3cef83e444048059c964bcdd9a10e8" }, "downloads": -1, "filename": "VectorDict-0.4.2.tar.gz", "has_sig": false, "md5_digest": "68ecaf48b9b51de6ab565ac116b9684d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24768, "upload_time": "2012-02-23T20:40:20", "url": "https://files.pythonhosted.org/packages/9c/2f/224d8f00dcbe6987f2ae17774ea1cfe70a6e02bde63d522e0587489fa48f/VectorDict-0.4.2.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "9021466be512ada158d73895a1e757bd", "sha256": "2add9ee9c58cd06dd367b48ce494934799a69d65aaab1c0d123b7a1f64728af8" }, "downloads": -1, "filename": "VectorDict-0.5.0.tar.gz", "has_sig": false, "md5_digest": "9021466be512ada158d73895a1e757bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25142, "upload_time": "2012-02-24T21:28:53", "url": "https://files.pythonhosted.org/packages/aa/85/d039eb10137f4a36f021339fbe98d7431c62876fab9e72067788913103ca/VectorDict-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "e948cfdadba63f711d7645b004df8c8f", "sha256": "4138182fd122748dc1d52f725d5af13ee16ab0a2522ecc8a442354904ab3db05" }, "downloads": -1, "filename": "VectorDict-0.6.0.tar.gz", "has_sig": false, "md5_digest": "e948cfdadba63f711d7645b004df8c8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28491, "upload_time": "2012-03-04T18:59:20", "url": "https://files.pythonhosted.org/packages/c8/df/466567a25d340528144ffe3bae6972677f5decf525379e22f7b3c8994792/VectorDict-0.6.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "9bd095b0dc8ded6739d7854d92114b83", "sha256": "1474ef959840d5ca5c68876cf08512cec660c7a924e67e5d684fd0f75a972467" }, "downloads": -1, "filename": "VectorDict-1.0.0.tar.gz", "has_sig": false, "md5_digest": "9bd095b0dc8ded6739d7854d92114b83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33648, "upload_time": "2012-04-12T12:38:26", "url": "https://files.pythonhosted.org/packages/f1/a0/35acea60c480acea68aabd7f5fafa5902aef5b44292bdf792472de4da4ae/VectorDict-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9bd095b0dc8ded6739d7854d92114b83", "sha256": "1474ef959840d5ca5c68876cf08512cec660c7a924e67e5d684fd0f75a972467" }, "downloads": -1, "filename": "VectorDict-1.0.0.tar.gz", "has_sig": false, "md5_digest": "9bd095b0dc8ded6739d7854d92114b83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33648, "upload_time": "2012-04-12T12:38:26", "url": "https://files.pythonhosted.org/packages/f1/a0/35acea60c480acea68aabd7f5fafa5902aef5b44292bdf792472de4da4ae/VectorDict-1.0.0.tar.gz" } ] }