{"id":16461501,"url":"https://github.com/jmoralez/window_ops","last_synced_at":"2026-02-18T06:00:35.088Z","repository":{"id":46727906,"uuid":"305804168","full_name":"jmoralez/window_ops","owner":"jmoralez","description":"Fast window operations","archived":false,"fork":false,"pushed_at":"2024-06-02T03:51:48.000Z","size":1491,"stargazers_count":45,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-14T07:36:47.711Z","etag":null,"topics":["expanding","numba","numpy","online","rolling"],"latest_commit_sha":null,"homepage":"https://jmoralez.github.io/window_ops/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmoralez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-20T18:49:42.000Z","updated_at":"2025-09-23T13:32:13.000Z","dependencies_parsed_at":"2024-10-31T10:05:54.739Z","dependency_job_id":"b4fb898f-33b6-4d50-a9ca-df41ddefdbe2","html_url":"https://github.com/jmoralez/window_ops","commit_stats":null,"previous_names":["jose-moralez/window_ops"],"tags_count":15,"template":false,"template_full_name":"fastai/nbdev_template","purl":"pkg:github/jmoralez/window_ops","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmoralez%2Fwindow_ops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmoralez%2Fwindow_ops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmoralez%2Fwindow_ops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmoralez%2Fwindow_ops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmoralez","download_url":"https://codeload.github.com/jmoralez/window_ops/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmoralez%2Fwindow_ops/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29569994,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T04:18:28.490Z","status":"ssl_error","status_checked_at":"2026-02-18T04:13:49.018Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expanding","numba","numpy","online","rolling"],"created_at":"2024-10-11T11:08:24.275Z","updated_at":"2026-02-18T06:00:34.888Z","avatar_url":"https://github.com/jmoralez.png","language":"Python","readme":"Window ops\n================\n\n\u003c!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! --\u003e\n\nThis library is intended to be used as an alternative to\n`pd.Series.rolling` and `pd.Series.expanding` to gain a speedup by using\nnumba optimized functions operating on numpy arrays. There are also\nonline classes for more efficient updates of window statistics.\n\n## Install\n\n### PyPI\n\n`pip install window-ops`\n\n## conda\n\n`conda install -c conda-forge window-ops`\n\n## How to use\n\n### Transformations\n\nFor a transformations `n_samples` -\\\u003e `n_samples` you can use\n`[seasonal_](rolling|expanding)_(mean|max|min|std)` on an array.\n\n#### Benchmarks\n\n``` python\npd.__version__\n```\n\n    '1.3.5'\n\n``` python\nn_samples = 10_000  # array size\nwindow_size = 8  # for rolling operations\nseason_length = 7  # for seasonal operations\nexecute_times = 10 # number of times each function will be executed\n```\n\nAverage times in milliseconds.\n\n``` python\ntimes.applymap('{:.2f}'.format)\n```\n\n\u003cdiv\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n  \u003cthead\u003e\n    \u003ctr style=\"text-align: right;\"\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003ewindow_ops\u003c/th\u003e\n      \u003cth\u003epandas\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003cth\u003erolling_mean\u003c/th\u003e\n      \u003ctd\u003e0.03\u003c/td\u003e\n      \u003ctd\u003e0.43\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003erolling_max\u003c/th\u003e\n      \u003ctd\u003e0.14\u003c/td\u003e\n      \u003ctd\u003e0.57\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003erolling_min\u003c/th\u003e\n      \u003ctd\u003e0.14\u003c/td\u003e\n      \u003ctd\u003e0.58\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003erolling_std\u003c/th\u003e\n      \u003ctd\u003e0.06\u003c/td\u003e\n      \u003ctd\u003e0.54\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eexpanding_mean\u003c/th\u003e\n      \u003ctd\u003e0.03\u003c/td\u003e\n      \u003ctd\u003e0.31\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eexpanding_max\u003c/th\u003e\n      \u003ctd\u003e0.05\u003c/td\u003e\n      \u003ctd\u003e0.76\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eexpanding_min\u003c/th\u003e\n      \u003ctd\u003e0.05\u003c/td\u003e\n      \u003ctd\u003e0.47\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eexpanding_std\u003c/th\u003e\n      \u003ctd\u003e0.09\u003c/td\u003e\n      \u003ctd\u003e0.41\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_rolling_mean\u003c/th\u003e\n      \u003ctd\u003e0.05\u003c/td\u003e\n      \u003ctd\u003e3.89\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_rolling_max\u003c/th\u003e\n      \u003ctd\u003e0.18\u003c/td\u003e\n      \u003ctd\u003e4.27\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_rolling_min\u003c/th\u003e\n      \u003ctd\u003e0.18\u003c/td\u003e\n      \u003ctd\u003e3.75\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_rolling_std\u003c/th\u003e\n      \u003ctd\u003e0.08\u003c/td\u003e\n      \u003ctd\u003e4.38\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_expanding_mean\u003c/th\u003e\n      \u003ctd\u003e0.04\u003c/td\u003e\n      \u003ctd\u003e3.18\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_expanding_max\u003c/th\u003e\n      \u003ctd\u003e0.06\u003c/td\u003e\n      \u003ctd\u003e3.29\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_expanding_min\u003c/th\u003e\n      \u003ctd\u003e0.06\u003c/td\u003e\n      \u003ctd\u003e3.28\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_expanding_std\u003c/th\u003e\n      \u003ctd\u003e0.12\u003c/td\u003e\n      \u003ctd\u003e3.89\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n``` python\nspeedups = times['pandas'] / times['window_ops']\nspeedups = speedups.to_frame('times faster')\nspeedups.applymap('{:.0f}'.format)\n```\n\n\u003cdiv\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n  \u003cthead\u003e\n    \u003ctr style=\"text-align: right;\"\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003etimes faster\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003cth\u003erolling_mean\u003c/th\u003e\n      \u003ctd\u003e15\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003erolling_max\u003c/th\u003e\n      \u003ctd\u003e4\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003erolling_min\u003c/th\u003e\n      \u003ctd\u003e4\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003erolling_std\u003c/th\u003e\n      \u003ctd\u003e9\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eexpanding_mean\u003c/th\u003e\n      \u003ctd\u003e12\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eexpanding_max\u003c/th\u003e\n      \u003ctd\u003e15\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eexpanding_min\u003c/th\u003e\n      \u003ctd\u003e9\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eexpanding_std\u003c/th\u003e\n      \u003ctd\u003e4\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_rolling_mean\u003c/th\u003e\n      \u003ctd\u003e77\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_rolling_max\u003c/th\u003e\n      \u003ctd\u003e23\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_rolling_min\u003c/th\u003e\n      \u003ctd\u003e21\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_rolling_std\u003c/th\u003e\n      \u003ctd\u003e52\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_expanding_mean\u003c/th\u003e\n      \u003ctd\u003e78\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_expanding_max\u003c/th\u003e\n      \u003ctd\u003e52\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_expanding_min\u003c/th\u003e\n      \u003ctd\u003e51\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eseasonal_expanding_std\u003c/th\u003e\n      \u003ctd\u003e33\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n### Online\n\nIf you have an array for which you want to compute a window statistic\nand then keep updating it as more samples come in you can use the\nclasses in the `window_ops.online` module. They all have a\n`fit_transform` method which take the array and return the\ntransformations defined above but also have an `update` method that take\na single value and return the new statistic.\n\n#### Benchmarks\n\nAverage time in milliseconds it takes to transform the array and perform\n100 updates.\n\n``` python\ntimes.to_frame().applymap('{:.2f}'.format)\n```\n\n\u003cdiv\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n  \u003cthead\u003e\n    \u003ctr style=\"text-align: right;\"\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003eaverage time (ms)\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003cth\u003eRollingMean\u003c/th\u003e\n      \u003ctd\u003e0.12\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eRollingMax\u003c/th\u003e\n      \u003ctd\u003e0.23\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eRollingMin\u003c/th\u003e\n      \u003ctd\u003e0.22\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eRollingStd\u003c/th\u003e\n      \u003ctd\u003e0.32\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eExpandingMean\u003c/th\u003e\n      \u003ctd\u003e0.10\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eExpandingMax\u003c/th\u003e\n      \u003ctd\u003e0.07\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eExpandingMin\u003c/th\u003e\n      \u003ctd\u003e0.07\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eExpandingStd\u003c/th\u003e\n      \u003ctd\u003e0.17\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eSeasonalRollingMean\u003c/th\u003e\n      \u003ctd\u003e0.28\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eSeasonalRollingMax\u003c/th\u003e\n      \u003ctd\u003e0.35\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eSeasonalRollingMin\u003c/th\u003e\n      \u003ctd\u003e0.38\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eSeasonalRollingStd\u003c/th\u003e\n      \u003ctd\u003e0.42\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eSeasonalExpandingMean\u003c/th\u003e\n      \u003ctd\u003e0.17\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eSeasonalExpandingMax\u003c/th\u003e\n      \u003ctd\u003e0.14\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eSeasonalExpandingMin\u003c/th\u003e\n      \u003ctd\u003e0.15\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eSeasonalExpandingStd\u003c/th\u003e\n      \u003ctd\u003e0.23\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmoralez%2Fwindow_ops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmoralez%2Fwindow_ops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmoralez%2Fwindow_ops/lists"}