{"id":21844012,"url":"https://github.com/blaylockbk/pandas-rose","last_synced_at":"2025-04-14T12:10:48.769Z","repository":{"id":185217243,"uuid":"673190941","full_name":"blaylockbk/pandas-rose","owner":"blaylockbk","description":"🐼🌹 A simple Pandas accessor for making windrose plots.","archived":false,"fork":false,"pushed_at":"2023-08-14T23:37:38.000Z","size":1666,"stargazers_count":15,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T01:14:26.374Z","etag":null,"topics":["pandas","windrose"],"latest_commit_sha":null,"homepage":"https://pandas-rose.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blaylockbk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-01T04:41:55.000Z","updated_at":"2024-07-29T20:32:45.000Z","dependencies_parsed_at":"2023-08-01T05:33:23.677Z","dependency_job_id":"aedc9b2c-f77d-4f33-a6a4-4a76a0e4dbf9","html_url":"https://github.com/blaylockbk/pandas-rose","commit_stats":{"total_commits":15,"total_committers":2,"mean_commits":7.5,"dds":0.06666666666666665,"last_synced_commit":"5f3ddd1eef0340d6d33e113f52a55ce166affb76"},"previous_names":["blaylockbk/pandas-rose"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaylockbk%2Fpandas-rose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaylockbk%2Fpandas-rose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaylockbk%2Fpandas-rose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaylockbk%2Fpandas-rose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blaylockbk","download_url":"https://codeload.github.com/blaylockbk/pandas-rose/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248370669,"owners_count":21092854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["pandas","windrose"],"created_at":"2024-11-27T22:18:08.765Z","updated_at":"2025-04-14T12:10:48.747Z","avatar_url":"https://github.com/blaylockbk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=center\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/blaylockbk/pandas-rose/main/images/pandas-rose.png\" title=\"Bing Image Creator: Cartoon chunky panda hugging rose in the wind pixel art \" width=200\u003e\n\n\u003c/div\u003e\n\n# Pandas Rose\n\nThis python package adds a custom Pandas accessor to generate polar wind rose plots from a Pandas dataframe.\n\nI don't mean to compete with the wonderful [windrose](https://github.com/python-windrose/windrose) package already available, but that package has a little too much complexity for what I wanted. This package is meant to provide a minimal, simple interface to making wind rose plots. This is done by using Pandas methods `pd.cut` and `df.groupby` and using Matplotlib regular polar axes.\n\n# Install\n\nInstall with pip. The requirements are only pandas, numpy, and matplotlib.\n\n```bash\npip install pandas-rose\n```\n\n# Usage\n\nPandas-rose is simple.\n\n```python\nimport pandas as pd\nimport rose\n\n# df is a pandas dataframe with columns\n# \"wind_speed\" and \"wind_direction\"\ndf = pd.DataFrame({\n    \"wind_speed\":[1,2,3,4],\n    \"wind_direction\":[20, 10, 190,300]\n})\n\n# Display a polar wind plot of the data\ndf.rose.plot()\n```\n\n![Alt text](https://raw.githubusercontent.com/blaylockbk/pandas-rose/main/images/sample_plot.png)\n\nYou can specify the pandas column to use for wind direction and wind speed. You may also change the number of sectors to bin the wind direction .\n\n```python\ndf.rose.plot(\n    var_column=\"A\",    # name of variable column\n    dir_column=\"B\",    # name of direction column\n    sectors=8,         # number of sectors (direction bins)\n    bins=range(0,30,5) # specify variable bins\n    normed=False       # If True, values as percentage instead of counts\n    colors='Blues'     # Name of matplotlib colormap or list of colors\n    )\n```\n\nThere are two other accessors that give some information.\n\n```python\n# Display a dataframe of the binned values\ndf.rose.table(sectors=8)\n```\n\n![Alt text](https://raw.githubusercontent.com/blaylockbk/pandas-rose/main/images/sample_table.png)\n\n```python\n# Display the binned data as bar graph on regular axes.\ndf.rose.bar()\n```\n\n![Alt text](https://raw.githubusercontent.com/blaylockbk/pandas-rose/main/images/sample_bar.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblaylockbk%2Fpandas-rose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblaylockbk%2Fpandas-rose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblaylockbk%2Fpandas-rose/lists"}