{"id":15501637,"url":"https://github.com/jeffzi/pandas-select","last_synced_at":"2025-04-22T22:33:46.677Z","repository":{"id":55395558,"uuid":"233844314","full_name":"jeffzi/pandas-select","owner":"jeffzi","description":"Supercharged pandas indexing","archived":false,"fork":false,"pushed_at":"2021-03-28T23:29:53.000Z","size":175,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T20:08:57.970Z","etag":null,"topics":["pandas","pandera","python","scikit-learn"],"latest_commit_sha":null,"homepage":"https://pandas-select.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeffzi.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2020-01-14T13:10:49.000Z","updated_at":"2024-10-11T13:09:12.000Z","dependencies_parsed_at":"2022-08-14T23:20:29.444Z","dependency_job_id":null,"html_url":"https://github.com/jeffzi/pandas-select","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffzi%2Fpandas-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffzi%2Fpandas-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffzi%2Fpandas-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffzi%2Fpandas-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeffzi","download_url":"https://codeload.github.com/jeffzi/pandas-select/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250334115,"owners_count":21413513,"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","pandera","python","scikit-learn"],"created_at":"2024-10-02T09:05:07.830Z","updated_at":"2025-04-22T22:33:46.653Z","avatar_url":"https://github.com/jeffzi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"==================================================\n``pandas-select``: Supercharged DataFrame indexing\n==================================================\n\n.. image:: https://github.com/jeffzi/pandas-select/workflows/tests/badge.svg\n   :target: https://github.com/jeffzi/pandas-select/actions\n   :alt: Github Actions status\n\n.. image:: https://codecov.io/gh/jeffzi/pandas-select/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/jeffzi/pandas-select\n   :alt: Coverage\n\n.. image:: https://readthedocs.org/projects/project-template-python/badge/?version=stable\n   :target: https://pandas-select.readthedocs.io/\n   :alt: Documentation status\n\n.. image:: https://img.shields.io/pypi/v/pandas-select.svg\n   :target: https://pypi.org/project/pandas-select/\n   :alt: Latest PyPI version\n\n.. image:: https://img.shields.io/pypi/pyversions/pandas-select.svg\n   :target: https://pypi.org/project/pandas-select/\n   :alt: Python versions supported\n\n.. image:: https://img.shields.io/pypi/l/pandas-select.svg\n   :target: https://pypi.python.org/pypi/pandas-select/\n   :alt: License\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n   :target: https://github.com/psf/black\n   :alt: Code style: black\n\n.. image:: https://img.shields.io/badge/style-wemake-000000.svg\n   :target: https://github.com/wemake-services/wemake-python-styleguide\n\n``pandas-select`` is a collection of DataFrame selectors that facilitates indexing\nand selecting data, fully compatible with pandas vanilla indexing.\n\nThe selector functions can choose variables based on their\n`name \u003chttps://pandas-select.readthedocs.io/en/latest/reference/label_selectors.html\u003e`_,\n`data type \u003chttps://pandas-select.readthedocs.io/en/latest/reference/label_selection.html#data-type-selectors\u003e`_,\n`arbitrary conditions \u003chttps://pandas-select.readthedocs.io/en/latest/reference/api/pandas_select.label.LabelMask.htmlk\u003e`_,\nor any `combination of these \u003chttps://pandas-select.readthedocs.io/en/latest/reference/label_selection.html#logical-operators\u003e`_.\n\n``pandas-select`` is inspired by the excellent R library `tidyselect \u003chttps://tidyselect.r-lib.org/reference/language.html\u003e`_.\n\n.. installation-start\n\nInstallation\n------------\n\n``pandas-select`` is a Python-only package `hosted on PyPI \u003chttps://pypi.org/project/pandas-select/\u003e`_.\nIt can be installed via `pip \u003chttps://pip.pypa.io/en/stable/\u003e`_:\n\n.. code-block:: console\n\n   pip install pandas-select\n\n.. installation-end\n\nDesign goals\n------------\n\n* Fully compatible with the\n  `pandas.DataFrame \u003chttps://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html\u003e`_\n  ``[]`` operator and the\n  `pandas.DataFrame.loc \u003chttps://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.loc.html?highlight=loc#pandas.DataFrame.loc\u003e`_\n  accessor.\n\n* Emphasise readability and conciseness by cutting boilerplate:\n\n.. code-block:: python\n\n   # pandas-select\n   df[AllNumeric()]\n   # vanilla\n   df.select_dtypes(\"number\").columns\n\n   # pandas-select\n   df[StartsWith(\"Type\") | \"Legendary\"]\n   # vanilla\n   df.loc[:, df.columns.str.startswith(\"Type\") | (df.columns == \"Legendary\")]\n\n* Ease the challenges of `indexing with hierarchical index \u003chttps://pandas.pydata.org/pandas-docs/stable/user_guide/advanced.html#advanced-indexing-with-hierarchical-index\u003e`_\n  and offers an alternative to `slicers \u003chttps://pandas.pydata.org/pandas-docs/stable/user_guide/advanced.html#advanced-mi-slicers\u003e`_\n  when the labels cannot be listed manually.\n\n.. code-block:: python\n\n    # pandas-select\n    df_mi.loc[Contains(\"Jeff\", axis=\"index\", level=\"Name\")]\n\n    # vanilla\n    df_mi.loc[df_mi.index.get_level_values(\"Name\").str.contains(\"Jeff\")]\n\n* Play well with machine learning applications.\n\n  - Respect the columns order.\n  - Allow *deferred selection* when the DataFrame's columns are not known in advance,\n    for example in automated machine learning applications.\n  - Offer integration with `sklearn \u003chttps://scikit-learn.org/stable/\u003e`_.\n\n    .. code-block:: python\n\n        from pandas_select import AnyOf, AllBool, AllNominal, AllNumeric, ColumnSelector\n        from sklearn.compose import make_column_transformer\n        from sklearn.preprocessing import OneHotEncoder, StandardScaler\n\n        ct = make_column_transformer(\n           (StandardScaler(), ColumnSelector(AllNumeric() \u0026 ~AnyOf(\"Generation\"))),\n           (OneHotEncoder(), ColumnSelector(AllNominal() | AllBool() | \"Generation\")),\n        )\n        ct.fit_transform(df)\n\n\nProject Information\n-------------------\n\n``pandas-select`` is released under the `BS3 \u003chttps://choosealicense.com/licenses/bsd-3-clause/\u003e`_ license,\nits documentation lives at `Read the Docs \u003chttps://pandas-select.readthedocs.io/\u003e`_,\nthe code on `GitHub \u003chttps://github.com/jeffzi/pandas-select\u003e`_,\nand the latest release on `PyPI \u003chttps://pypi.org/project/pandas-select/\u003e`_.\nIt is tested on Python 3.6+.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffzi%2Fpandas-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeffzi%2Fpandas-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffzi%2Fpandas-select/lists"}