# pandas — card for AI agents

Data manipulation and analysis library with DataFrames for structured data.

Category: ML and data science · PyPI package `pandas` · latest version 3.1.0 (checked 2026-11-01)
Install: `pip install pandas`
License: BSD-3-Clause (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## pandas
- Install and run pandas inside a virtual environment (for example `venv`, or a conda env from conda-forge).
- Declare the extras a feature needs in `requirements.txt` or `pyproject.toml`, e.g. `pandas[excel]`, `pandas[parquet]`, `pandas[aws]`.
- Expect an `ImportError` at call time when a method's optional dependency is missing; add the matching extra rather than catching the error.
- For large data sets, add `pandas[performance]` (numexpr, bottleneck, numba).
- For `read_html()`, install BeautifulSoup4 together with lxml or html5lib, never BeautifulSoup4 alone.
- Read xls/xlsb files with python-calamine, not the deprecated xlrd or pyxlsb.
- For `read_orc()`, install pyarrow with conda; it may fail with pyarrow from PyPI and is not compatible with Windows.

## Agent Skills for it
- pandas-pro from Jeffallan/claude-skills: `npx skills add Jeffallan/claude-skills --skill pandas-pro`
- pandas-pro from midudev/autoskills: `npx skills add midudev/autoskills --skill pandas-pro`

## What it is
- pandas is a Python library for working with tabular data. The README says it provides "fast, flexible, and expressive data structures" for "relational" or "labeled" data. The GitHub description compares those structures to R `data.frame` objects. The repository was created on 2010-08-24 and is BSD-3-Clause licensed. The latest release is 3.1.1, a patch release in the 3.1.x series with regression and bug fixes.
- The core objects are `Series` and `DataFrame`. Data aligns on labels during computations. The README lists group by, merging and joining, reshaping and pivoting, hierarchical axis labels, and time series tools. Its I/O list covers CSV, Excel, databases and HDF5.
- Installation has two layers. The required set is NumPy, python-dateutil and tzdata, and tzdata is only needed on Windows and Pyodide. Everything else comes through extras such as `pandas[excel]`, `pandas[performance]` or `pandas[all]`. The docs say these optional dependencies "are only used for specific methods."

## Caveats
- Missing extras surface as ImportError on use: pandas raises `ImportError` when you call a method whose optional dependency is not installed. For example, `read_hdf()` needs pytables and `to_markdown()` needs tabulate.
- read_html needs more than BeautifulSoup: BeautifulSoup4 alone is not enough for `read_html()`. The docs say you must also install lxml, html5lib, or both.
- read_orc() and pip-installed pyarrow: The docs say `read_orc()` "may fail if pyarrow was installed from pypi" and recommend installing pyarrow with conda. They also say `read_orc()` is not compatible with Windows.
- Two Excel readers are deprecated: xlrd (for xls) and pyxlsb (for xlsb) are marked deprecated. The docs point to python-calamine instead.
- Older optional deps are untested: Minimum versions for optional dependencies are about one year old. The docs say older versions may still work but are not tested or supported.

## Numbers (AgentGid data)
- Gid Score: 87.7 (#18 of all tools, 1 of 293 in its category)
- Used in 268 public projects set up for AI coding agents (4.3%)
- Downloads last week: 164,021,300 (as of 2026-11-24), +15.3% over 4 weeks
- GitHub stars: 50,610 (as of 2026-11-24)
- Last push: 2026-11-23

## Often used with
NumPy 70.5%, python-dotenv 50.0%, Requests 46.6%, Pydantic 41.0%, scikit-learn 38.4%, Matplotlib 38.1%

## Links
- AgentGid page: https://agentgid.com/tools/pandas/
- Homepage: https://pandas.pydata.org
- Repository: https://github.com/pandas-dev/pandas
- Source: https://github.com/pandas-dev/pandas#readme
- Source: https://github.com/pandas-dev/pandas
- Source: https://github.com/pandas-dev/pandas/releases
- Source: https://pandas.pydata.org/docs/getting_started/install.html#dependencies


## pandas: tables of data in Python, like a spreadsheet in code

pandas is a free Python library for working with tables of data in code. Your app or script reads a CSV or Excel file, cleans gaps, sums and groups rows, and saves a report or a chart. It works on data that fits in the computer's memory; much bigger data needs other tools.

### Where to use it
- Monthly sales report from a CSV: Turn an export of orders into a table of revenue per month and product, ready for a dashboard or an email.
- Clean messy exports before import: Find and drop rows with empty fields, fix types and remove duplicates before data goes into your database.
- Totals per customer group: Sum revenue per city, plan or customer and sort the biggest first.
- Chart for a weekly update: Draw a bar or line chart straight from the table and save it as an image for a report or a site.
- Join two data sources: Combine a payments export with a customer list by customer ID to see who paid what.
- Answer data questions from an AI agent: An AI assistant loads an uploaded spreadsheet into pandas and answers questions like "which month sold most mugs". (idea, not from the official pages)

### How to start
- Install pandas into your project's Python environment (Python 3.11 or newer).

```
pip install pandas
```

- For Excel files, install the optional Excel extras too.

```
pip install "pandas[excel]"
```


### License
Free to use, also in paid and closed products, under the BSD 3-Clause license. Keep the license notice when you ship pandas, and do not use its contributors' names to promote your product.

### Good to know
- pandas 3 needs Python 3.11 or newer.
- Version 3 changed two defaults: text columns get their own str type, and every selection behaves as a copy. Old code and old tutorials can break.
- It keeps the whole table in memory, so files close to your memory size get slow or fail.
- Excel files and charts need extra packages, such as openpyxl and matplotlib.
- The project is active; version 3.1.1 came out on 4 November 2026.

Checked 2026-11-11 against: https://pandas.pydata.org/, https://pandas.pydata.org/docs/getting_started/overview.html, https://pandas.pydata.org/docs/getting_started/install.html, https://pandas.pydata.org/docs/whatsnew/v3.0.0.html, https://pandas.pydata.org/docs/whatsnew/v2.0.0.html, https://pandas.pydata.org/docs/user_guide/scale.html, https://github.com/pandas-dev/pandas/blob/main/LICENSE, https://pypi.org/pypi/pandas/json

### Mistakes to avoid
- Don't: df["flag"][df["qty"] > 4] = "big" → Do: df.loc[df["qty"] > 4, "flag"] = "big" (In pandas 3 chained assignment never changes df; in our run it left the column unchanged and raised a ChainedAssignmentError warning.)
- Don't: if df["name"].dtype == object → Do: Use pd.api.types.is_string_dtype(df["name"]), or compare with "str" (Text columns now load as the str type; in our run df["flag"].dtype == object was False.)
- Don't: df = df.append(row_df) → Do: df = pd.concat([df, row_df], ignore_index=True) (DataFrame.append was removed in pandas 2.0; in our run it raised AttributeError.)
- Don't: pip install pandas, then pd.read_excel("file.xlsx") → Do: pip install "pandas[excel]" (or add openpyxl) before reading .xlsx files (Excel readers are optional packages and are not installed with pandas itself.)
- Don't: pip install pandas==3.1.1 on Python 3.9 or 3.10 → Do: Make a virtual environment on Python 3.11 or newer first (pandas 3 supports only Python 3.11 and higher.)

### Questions
- Can it read Excel files? Yes, after you install the Excel extras (pip install "pandas[excel]"), which bring openpyxl and related readers.
- Why does my old code df["col"][mask] = value no longer change anything? In pandas 3 every selection is a copy, so this chained assignment does nothing. Write df.loc[mask, "col"] = value.
- Where did DataFrame.append go? It was removed in pandas 2.0; use pd.concat instead.
- Can pandas handle a 50 GB file on a laptop? Not directly. It works in memory; its docs suggest loading fewer columns, smaller types or other libraries for data larger than memory.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
