Registry / data / pandas

pandas

JSON →
library3.0.5pypypi✓ verified 26d ago

The standard Python DataFrame library for data analysis. Current version is 3.0.1 (Feb 2026). pandas 3.0 is a major release with two ecosystem-wide breaking changes: Copy-on-Write (CoW) is now the only mode, and string columns now default to str dtype instead of object. Requires Python >=3.11.

pip install pandas
INSTALL
IMPORT
SIG · PANDAS
P
pandas
datapythonv3.0.5
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.3.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
2/4 runs
3/4 runs
py 3.11
2/4 runs
3/4 runs
py 3.12
2/4 runs
3/4 runs
py 3.13
2/4 runs
3/4 runs
py 3.9
2/4 runs
3/4 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pandas
import pandas as pd df = pd.DataFrame({'a': [1, 2], 'b': ['x', 'y']}) # Modify using loc in one step df.loc[df['a'] > 1, 'b'] = 'z'
df['b'][df['a'] > 1] = 'z' # chained assignment — silently fails in pandas 3.0 (CoW)
Copy-on-Write is now mandatory in 3.0. Chained assignment (df['col'][mask] = val) no longer modifies the DataFrame — it silently does nothing.
string dtype
ser = pd.Series(['a', 'b']) ser.dtype # dtype('str') in pandas 3.0 # Check for string dtype in 3.0-compatible way: if pd.api.types.is_string_dtype(ser): ...
if df['col'].dtype == object: # no longer true for string columns in pandas 3.0 ...
String columns now infer to str dtype instead of numpy object. Code checking dtype == object or dtype == 'O' for string detection will silently miss string columns.

pandas 3.0 patterns. Use loc for in-place modification. Strings are str dtype not object.

import pandas as pd import numpy as np # Create DataFrame df = pd.DataFrame({ 'name': ['Alice', 'Bob', 'Charlie'], 'score': [85, 92, 78], 'dept': ['eng', 'eng', 'mkt'] }) # Correct modification in pandas 3.0 (CoW) df.loc[df['score'] > 80, 'grade'] = 'pass' # Or use assign() for derived columns (returns new DataFrame) df = df.assign(grade=lambda x: np.where(x['score'] > 80, 'pass', 'fail')) # Check dtypes — strings are now 'str', not 'object' print(df.dtypes) # name str # score int64 # dept str
Debug
Known issues
breakingCopy-on-Write (CoW) is now the only mode in pandas 3.0. Chained assignment df['col'][mask] = value silently does nothing — no error, no warning, no modification. This is the most common invisible bug when upgrading.
fix
Use df.loc[mask, 'col'] = value for conditional assignment. Use df = df.assign(col=...) for derived columns. Remove all defensive .copy() calls added to silence old SettingWithCopyWarning.
affects: >= 3.0
breakingString columns now default to str dtype instead of numpy object dtype. Code checking dtype == object or dtype == 'O' to detect string columns will fail silently in pandas 3.0.
fix
Replace dtype == object checks with pd.api.types.is_string_dtype(col) or dtype == 'str'. For library code: handle both 'object' and 'str' dtypes during transition.
affects: >= 3.0
breakingPython 3.10 and below dropped. pandas 3.0 requires Python >=3.11.
fix
Pin pandas<3.0 for Python <=3.10 environments. Upgrade Python to 3.11+ to use pandas 3.0.
affects: >= 3.0
breakingDatetime default resolution changed from nanoseconds to microseconds (or input resolution). pd.Timestamp arithmetic and comparisons with nanosecond precision may produce different results.
fix
Explicitly pass unit='ns' where nanosecond precision is required: pd.to_datetime(arr, unit='ns').
affects: >= 3.0
breakingDataFrame.groupby() observed parameter default changed to True for Categorical columns. Previously unobserved categories were included by default, causing silent behavior changes on groupby aggregations.
fix
Pass observed=False explicitly to restore old behavior if unobserved categories are needed.
affects: >= 2.2
deprecatedmode.copy_on_write option deprecated — setting it has no effect in pandas 3.0 and will be removed in 4.0.
fix
Remove pd.options.mode.copy_on_write = True/False from your code — CoW is always on.
affects: >= 3.0
gotchapyarrow is not required but strongly recommended for pandas 3.0. Without pyarrow, the new str dtype falls back to numpy object-backed storage, losing most performance benefits.
fix
pip install pyarrow alongside pandas. Verified by: pd.Series(['a']).dtype shows 'str' regardless, but performance differs significantly.
affects: >= 3.0
gotchaMany third-party libraries (scikit-learn, seaborn, statsmodels, SHAP) had pandas 3.0 compatibility issues at release. Check library versions when upgrading.
fix
Test your full dependency stack against pandas 3.0 before upgrading. Use pandas 2.3.x as a stepping stone to surface deprecation warnings first.
affects: >= 3.0
gotchaBuilding `psycopg2` from source fails due to missing PostgreSQL development headers and libraries (`pg_config`). This is a common issue in minimal environments.
fix
Ensure PostgreSQL development headers are installed, or install the `psycopg2-binary` package instead of `psycopg2` (e.g., `pip install psycopg2-binary`). For Debian/Ubuntu, `apt-get install libpq-dev`.
affects: N/A (dependency issue, not pandas version specific)
gotchaInstalling `pandas[performance]` (which requires numba and llvmlite) may fail in minimal environments (e.g., Alpine Linux) due to missing system build tools like `gcc` and `cmake`, which are necessary for compiling these dependencies.
fix
Ensure that essential build tools are installed in your environment before installing `pandas[performance]`. For Alpine Linux, use `apk add build-base cmake`.
affects: >= 3.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pandas'
The pandas library is not installed in the Python environment where the code is being executed.
fix
Install pandas using pip: `pip install pandas` (or `conda install pandas` if using Anaconda).
KeyError: 'some_column_name'
Attempting to access a DataFrame column or index label that does not exist in the DataFrame, often due to typos, incorrect casing, or hidden whitespace in column names.
fix
Verify the exact column names using `df.columns` and correct any typos or casing issues. It's often helpful to strip whitespace from column names: `df.columns = df.columns.str.strip()`.
AttributeError: 'DataFrame' object has no attribute 'append'
The `append()` method for DataFrames and Series was deprecated in pandas 1.4.0 and completely removed in pandas 2.0 and later versions.
fix
Replace `df.append()` with `pd.concat()` for combining DataFrames or Series. Example: `new_df = pd.concat([df1, df2])`.
AttributeError: module 'pandas' has no attribute 'dataframe'
Incorrect capitalization when trying to create a DataFrame; the class name for DataFrame must start with a capital 'D'.
fix
Use `pd.DataFrame()` with a capital 'D' for DataFrame. Example: `df = pd.DataFrame({'col1': [1, 2]})`.
ChainedAssignmentError: A value is trying to be set on a copy of a slice from a DataFrame.
In pandas 3.0, Copy-on-Write (CoW) is enabled by default, making chained assignments (e.g., `df[condition]['column'] = value`) reliably operate on a temporary copy, not the original DataFrame. This error prevents silent, incorrect modifications that previously might have only issued a `SettingWithCopyWarning`.
fix
Use `.loc` for a single-step, explicit assignment to ensure modification of the original DataFrame. Example: `df.loc[df['column_a'] > 5, 'column_b'] = new_value`.
Upgrade
Version history
3.0.5latest on PyPI · released Jul 22, 2026
Audit
Dependencies
numpy>=1.23.2requiredRequired. Installed automatically.
python-dateutil>=2.8.2requiredRequired. Installed automatically.
pyarrow>=10.0.1optionalStrongly recommended. Backs the new str dtype for better performance. Not required but highly beneficial.
openpyxloptionalRequired for read_excel() and to_excel() with .xlsx files.
Agent activity
5 hits · last 30 days
node
4
Resources