{ "info": { "author": "Lincoln Turner", "author_email": "lincoln.turner@monash.edu", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7" ], "description": "# upandas\n\nupandas makes it easy to use quantities with uncertainties in pandas DataFrames and Series.\n\nupandas relies on the excellent [uncertainties]() package, and of course [pandas](). \n\n```python\n# A dataframe with nominal values in columns x and y,\n# and their respective uncertainties in u_x, u_y\n\nIn [1]: n=3; df = pd.DataFrame({ 'x': randn(n), 'u_x': 0.1*rand(n),\n ...: 'y': randn(n), 'u_y': 0.1*rand(n) })\n\nIn [2]: df\nOut[2]:\n x u_x y u_y\n0 -1.735288 0.014020 -1.426411 0.093879\n1 -0.677756 0.084329 -1.254212 0.034601\n2 2.410181 0.054435 -1.611307 0.020315\n\n# Convert col/u_col pairs to uarray columns\nIn [3]: uf = separate_to_u(df)\nIn [4]: uf\nOut[4]:\n x y\n0 -1.735+/-0.014 -1.43+/-0.09\n1 -0.68+/-0.08 -1.254+/-0.035\n2 2.41+/-0.05 -1.611+/-0.020\n\n# Operate on columns in the DataFrame as usual,\n# but propagate the uncertainties\nIn [5]: uf['xy2'] = uf['x'] * uf['y']**2\nIn [6]: uf\nOut[6]:\n x y xy2\n0 -1.735+/-0.014 -1.43+/-0.09 -3.5+/-0.5\n1 -0.68+/-0.08 -1.254+/-0.035 -1.07+/-0.15\n2 2.41+/-0.05 -1.611+/-0.020 6.26+/-0.21\n\n# Convert back to a conventional dataframe\n# for e.g. storage to HDF5.\nIn [17]: u_to_separate(uf)\nOut[17]:\n x u_x y u_y xy2 u_xy2\n0 -1.735288 0.014020 -1.426411 0.093879 -3.530698 0.465620\n1 -0.677756 0.084329 -1.254212 0.034601 -1.066143 0.145112\n2 2.410181 0.054435 -1.611307 0.020315 6.257576 0.211830\n```\n\n## Getting Started\n\n### Prerequisites\n\nupandas relies on uncertainties and pandas,\nbut pip will install these if needed. \n\n### Installing\n\n```\npip install upandas\n```\n\n## Running the tests\n\nBasic tests are included, using [pytest](https://docs.pytest.org/en/latest/index.html). In the base directory:\n```\npytest tests \n```\nor just `make test`.\n\n## Usage\n\nupandas so far provides only two functions:\n\n- `separate_to_u(df)`: converts col, u_col pairs to a uarray column col.\n- `u_to_separate(df)`: converts a uarray column col to a pair col, u_col.\n\nIf applied to a Series, these functions look at the 'row' index rather than columns.\n\n## Built With\n\n- [poetry](https://poetry.eustace.io/)\n\nNote that as a 'modern' python project and uses [pyproject.toml](pyproject.toml) rather than setuptools `setup.py`.\n\nIf you want to develop locally, pull this repository and execute... TBC.\n\n## Contributing\n\nPlease do send me pull requests!\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. \n\n## Authors\n\n- *Lincoln Turner* - [lincolndturner](https://bitbucket.org/lincolndturner)\n\n## TODO\n\n- MultiIndex support.\n- Make ufloats a pandas [extensions type](https://pandas.pydata.org/pandas-docs/stable/development/extending.html#extension-types), although not clear this is needed.\n- Make uarrays a pandas [https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.api.extensions.ExtensionArray.html#pandas.api.extensions.ExtensionArray] extension array, although again not clear if this is needed.\n- Register pandas [custom accessors](https://pandas.pydata.org/pandas-docs/stable/development/extending.html#registering-custom-accessors), so that we can be a bit more pythonic about the conversion: `df.u.from_separate()...`,\n- ... and `df.u.nomnal_values`, `df.u.std_devs`.\n- More tests\n\n## License\n\nThis project is licensed under the Monash/BSD 2-Clause License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\nInspired by the extensive support of uncertainties \nin [lyse](https://bitbucket.org/labscript_suite/lyse/),\nas part of the [labscript suite](http://labscriptsuite.org/).\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/lincolndturner/upandas", "keywords": "pandas,uncertainties,uarray,dataframe,errors", "license": "BSD-2-Clause", "maintainer": "Lincoln Turner", "maintainer_email": "lincoln.turner@monash.edu", "name": "upandas", "package_url": "https://pypi.org/project/upandas/", "platform": "", "project_url": "https://pypi.org/project/upandas/", "project_urls": { "Homepage": "https://bitbucket.org/lincolndturner/upandas", "Repository": "https://bitbucket.org/lincolndturner/upandas" }, "release_url": "https://pypi.org/project/upandas/0.2.0/", "requires_dist": [ "pandas (>=0.24,<0.25)", "uncertainties (>=3.1,<4.0)" ], "requires_python": ">=3.7,<4.0", "summary": "Handle uncertainties within pandas dataframes and series", "version": "0.2.0" }, "last_serial": 5412996, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "febc34add11814ee3c26ce40f017e147", "sha256": "425a031aa6553deac9fd0d82e69b4aca664be8a1c90126ad582ebac0e3535184" }, "downloads": -1, "filename": "upandas-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "febc34add11814ee3c26ce40f017e147", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7,<4.0", "size": 5172, "upload_time": "2019-06-18T02:20:21", "url": "https://files.pythonhosted.org/packages/f8/12/a210a5088cbd370f12885016f17c9d1e9583f10d063cf30cece621eafccc/upandas-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "524e4c5cee91677deb2fb38708b21d8f", "sha256": "a18e6cdd637b147820373da95d71dafe0b7b0866047af3829f6a0e4d01c8fc18" }, "downloads": -1, "filename": "upandas-0.1.0.tar.gz", "has_sig": false, "md5_digest": "524e4c5cee91677deb2fb38708b21d8f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 5394, "upload_time": "2019-06-18T02:20:24", "url": "https://files.pythonhosted.org/packages/73/35/85c406b64f1daf88188b73ccebd33a3193880a0e05c4862d0df2d5ca8460/upandas-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "ce744bc06da8d05fd31c5f4d3ee11f53", "sha256": "90ebd18dcdae68f9ded595073b78890c95dadd3ecbd7297bdc690302dcc22250" }, "downloads": -1, "filename": "upandas-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ce744bc06da8d05fd31c5f4d3ee11f53", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7,<4.0", "size": 5172, "upload_time": "2019-06-18T02:40:33", "url": "https://files.pythonhosted.org/packages/ce/07/b810e999ff36aa1679b1c05b8d6dfd0b7e9f0cb5af5d21a23ec95271634d/upandas-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "073cf2a4d738f36c26e3e9599bd158df", "sha256": "7d62369cc25e103fbaa4031f5428a212fe190aedef5daf50ae9f6376773b1fe1" }, "downloads": -1, "filename": "upandas-0.2.0.tar.gz", "has_sig": false, "md5_digest": "073cf2a4d738f36c26e3e9599bd158df", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 5484, "upload_time": "2019-06-18T02:40:35", "url": "https://files.pythonhosted.org/packages/0c/3f/defa893a23f789ace92acbccae181c315f4ac8f2989d2efb0d053f525184/upandas-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ce744bc06da8d05fd31c5f4d3ee11f53", "sha256": "90ebd18dcdae68f9ded595073b78890c95dadd3ecbd7297bdc690302dcc22250" }, "downloads": -1, "filename": "upandas-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ce744bc06da8d05fd31c5f4d3ee11f53", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7,<4.0", "size": 5172, "upload_time": "2019-06-18T02:40:33", "url": "https://files.pythonhosted.org/packages/ce/07/b810e999ff36aa1679b1c05b8d6dfd0b7e9f0cb5af5d21a23ec95271634d/upandas-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "073cf2a4d738f36c26e3e9599bd158df", "sha256": "7d62369cc25e103fbaa4031f5428a212fe190aedef5daf50ae9f6376773b1fe1" }, "downloads": -1, "filename": "upandas-0.2.0.tar.gz", "has_sig": false, "md5_digest": "073cf2a4d738f36c26e3e9599bd158df", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 5484, "upload_time": "2019-06-18T02:40:35", "url": "https://files.pythonhosted.org/packages/0c/3f/defa893a23f789ace92acbccae181c315f4ac8f2989d2efb0d053f525184/upandas-0.2.0.tar.gz" } ] }