{ "info": { "author": "NGeorgescu", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "======================\npython-moving-average\n======================\n\nWhy??\n------\nNumpy does not include a built-in moving average function as of yet. \nMost solutions are tedious and complicated and not one liners.\nThis operates similar to the Wolfram Language's `MovingAverage[]` function, but\nhas the advantage that it can specify axis for higher ndim arrays.\n\nUsage\n------\nSee docs for examples. But essentially, the usage is just:\n::\n\n from mvgavg import mvgavg\n\n mvgavg(array, n, axis=0, weights = [list of weights])\n mvgavg(array, n, axis=0, binning = bool)\n\n\nWhat This Code Does\n--------------------\nConsider the array `[a,b,c,d, ... x, y, z]`. Taking the moving average of\nlength `n=3` results in a new array wherein the first element is `(a+b+c)/3`, the\nsecond `(b+c+d)/3` and so on. This can be done for arrays of arbitrary depth,\nso if you put in a time series `[[t1,x1],[t2,x2],...]`, a moving average of \nalong `axis=0` (the default) will give you back the moving average of all t's\nalong side all x's.\n\nThe output is a vector that is the same size and shape but has been shortened\non the `axis` axis by a length of `n-1`, unless `binning=True` (see below).\n\nThe structure of this code is that it runs a cumulative sum moving average if there\nis no weights or binning, as this is the fastest moving average typically,\nespecially for wide or high `ndim` arrays. On the other hand, if either weights\nor binning is used, the appropriate function is selected.\n\n\nAxis and Weight Options\n------------------------\nAxis: The axis lets you operate at an increased depth, so using the `axis=1`\nparameter, you can operate horizontally across columns with your moving average.\nYou can do this as deep as the array itself.\n\nBinning\n-------\nBinning greatly shortens the array and loses some precision. This is desirable\nif you have an enormous amount of data and don't need to preserve every point. The\ndifference between a default moving average and a binned moving average is that,\nfor an input array [a b c d e f...] and an output [A B C D E F...] over distance\n3, the default moving average looks like this: ::\n\n A = [a b c]/3\n B = [b c d]/3\n C = [c d e]/3\n D = [d e f]/3\n E = [e f g]/3\n ....\n\nbut if `binning = True`: ::\n\n A = [a b c]/3\n B = [d e f]/3\n C = [g h i]/3\n .....\n\nAs you can see the output array is greatly shortened. As arrays get very large,\nbinning can become orders of magnitude faster to compute, and if you don't need the\nresolution of a moving average, are a much more efficient way of handling data,\nbecause you may end up throwing most of your data away later when you go to plot\nit up anyways.\n\nWhy Is This Function Important?\n-------------------------------\nMoving averages smooth data and illuminate trends that otherwise may not be\nas apparent. They also help with reverse interpolation when different x's\nyield the same y. The reasons for using moving averages are myriad, so a\ndecent arbitrary-depth moving average function with numpy-speed and arbitrary\nweighting needed to be written.\n\nAcknowledgements\n----------------\nCredit to @fnjn on github for the sliding window function.\n\nMisc\n-------\nIf you have issues or questions, open an issue on Github at \nhttps://github.com/NGeorgescu/python-moving-average or if you think there's some\nfunctionality that you would like to see, or if you have a faster algorithm\n\nThanks and Enjoy!\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "mvgavg moving average movingaverage numpy python binning binned running run", "license": "see LICENSE.txt", "maintainer": "", "maintainer_email": "", "name": "mvgavg", "package_url": "https://pypi.org/project/mvgavg/", "platform": "", "project_url": "https://pypi.org/project/mvgavg/", "project_urls": null, "release_url": "https://pypi.org/project/mvgavg/0.1.0/", "requires_dist": [ "numpy" ], "requires_python": "", "summary": "Moving averages", "version": "0.1.0" }, "last_serial": 5790042, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "51521916b6ab306472cbe9a87d0d751b", "sha256": "458a5bea1389c443b774f0b1346957170c95e2a3216266a89eec174dc631ef8b" }, "downloads": -1, "filename": "mvgavg-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "51521916b6ab306472cbe9a87d0d751b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15125, "upload_time": "2019-07-13T01:14:12", "url": "https://files.pythonhosted.org/packages/c3/91/a233da8ddde5cf6e4f659843b1983fe8b910f0770a2f617a208bd0227ace/mvgavg-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6e5ea922412a89c38bc696abd488849a", "sha256": "6fed96ac88f9d7e21b86e355c4be480b94f3b17524196ceff71e9820ac542570" }, "downloads": -1, "filename": "mvgavg-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6e5ea922412a89c38bc696abd488849a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2997, "upload_time": "2019-07-13T01:14:14", "url": "https://files.pythonhosted.org/packages/43/64/37cce97d4ba628e096d7c1813484ecf3e3589a04159e85b6404a436b2059/mvgavg-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "4608a3c9cba2739ff1e5608d95d8d649", "sha256": "d98f784bfe5490e83a56415f27f3f1376ff54c0ae19bcda49b401f4f04b244cf" }, "downloads": -1, "filename": "mvgavg-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4608a3c9cba2739ff1e5608d95d8d649", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17815, "upload_time": "2019-07-13T01:25:13", "url": "https://files.pythonhosted.org/packages/c5/9c/96857d16a7824b1a68e7f0e6bb6aee293bfad91955c86ec9971efd9b70e9/mvgavg-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b0f7abb1c84aa4a18ff06338a94f23aa", "sha256": "57a559389a8ade11066d105bafd473cdaad845b6096bda0d185d5d9b72aea246" }, "downloads": -1, "filename": "mvgavg-0.0.2.tar.gz", "has_sig": false, "md5_digest": "b0f7abb1c84aa4a18ff06338a94f23aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4840, "upload_time": "2019-07-13T01:25:16", "url": "https://files.pythonhosted.org/packages/89/95/2013d8738e75d4b1251ac26b9bfdb058ab60b4fd7cf73f9e9e37adf9ab4b/mvgavg-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "e54ddc1e2021ae4643e4819bc4ba33f2", "sha256": "42401a0759056008250ea904ca93ff62a20ee6fef93694a3c9c52daf818a9c72" }, "downloads": -1, "filename": "mvgavg-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "e54ddc1e2021ae4643e4819bc4ba33f2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17818, "upload_time": "2019-07-13T01:29:31", "url": "https://files.pythonhosted.org/packages/43/cb/cfb2ab08590bd44c383ca74b85c4c9abc71210f752bee7d78636b281a78c/mvgavg-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c935f0af82dbf7c39d43a77196c5717", "sha256": "44ff81e9644d4c35799b6818c63d01939680665cc7d845ed932139a22a39a992" }, "downloads": -1, "filename": "mvgavg-0.0.3.tar.gz", "has_sig": false, "md5_digest": "8c935f0af82dbf7c39d43a77196c5717", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4841, "upload_time": "2019-07-13T01:29:34", "url": "https://files.pythonhosted.org/packages/62/d9/00e47362a2c6b48dadfe1523a8cee2957778dfd02a33a6449d747931ae45/mvgavg-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "c5194c79374b553ad00744b58192e03e", "sha256": "cf42e4404bdcefe01ed93d89be20a308c2bd806a5d1acde773279bcc7ad9e0c2" }, "downloads": -1, "filename": "mvgavg-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "c5194c79374b553ad00744b58192e03e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17830, "upload_time": "2019-09-04T11:57:13", "url": "https://files.pythonhosted.org/packages/cf/49/b54357cf91b8639187c69e9aa737b4a000fd4b6129566f16037efb7ed2e3/mvgavg-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "260b9e20b92cc0ba77ed59063c7964d4", "sha256": "1ab36d29ea44e9b58e633c1b910b90b407d7897416fbccaff755a8d9fc49d5f1" }, "downloads": -1, "filename": "mvgavg-0.0.4.tar.gz", "has_sig": false, "md5_digest": "260b9e20b92cc0ba77ed59063c7964d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4883, "upload_time": "2019-09-04T11:57:18", "url": "https://files.pythonhosted.org/packages/e4/34/54031bdefd7cd5df51354075e2ac7d790d6a7f9f1bc4af69000020caa058/mvgavg-0.0.4.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "0bd22ebef729250a72c17c03dcc9c601", "sha256": "3ae8c91a51734d4ac2aedeaebab8993626b76ff682550f2b71f212bb6a8bd2bd" }, "downloads": -1, "filename": "mvgavg-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0bd22ebef729250a72c17c03dcc9c601", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17523, "upload_time": "2019-09-06T04:37:55", "url": "https://files.pythonhosted.org/packages/a9/1a/c45ab481f1cbc25d785910d1d82f46a2def3c00adb34f9c24cdadac272ba/mvgavg-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "327dd5ab4293d02db153f1a64bf65334", "sha256": "052aecc619dd9ad6a52687f1e107add535c881bd65b85b8f913a9635bbf0ae58" }, "downloads": -1, "filename": "mvgavg-0.1.0.tar.gz", "has_sig": false, "md5_digest": "327dd5ab4293d02db153f1a64bf65334", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4535, "upload_time": "2019-09-06T04:38:00", "url": "https://files.pythonhosted.org/packages/00/c6/46e10c392b8014c06b97f7bf4995aa3dcb5e31c3121ffd050df44f26f3be/mvgavg-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0bd22ebef729250a72c17c03dcc9c601", "sha256": "3ae8c91a51734d4ac2aedeaebab8993626b76ff682550f2b71f212bb6a8bd2bd" }, "downloads": -1, "filename": "mvgavg-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0bd22ebef729250a72c17c03dcc9c601", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17523, "upload_time": "2019-09-06T04:37:55", "url": "https://files.pythonhosted.org/packages/a9/1a/c45ab481f1cbc25d785910d1d82f46a2def3c00adb34f9c24cdadac272ba/mvgavg-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "327dd5ab4293d02db153f1a64bf65334", "sha256": "052aecc619dd9ad6a52687f1e107add535c881bd65b85b8f913a9635bbf0ae58" }, "downloads": -1, "filename": "mvgavg-0.1.0.tar.gz", "has_sig": false, "md5_digest": "327dd5ab4293d02db153f1a64bf65334", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4535, "upload_time": "2019-09-06T04:38:00", "url": "https://files.pythonhosted.org/packages/00/c6/46e10c392b8014c06b97f7bf4995aa3dcb5e31c3121ffd050df44f26f3be/mvgavg-0.1.0.tar.gz" } ] }