Skip to content

BUG: raise on non-1D numeric and datetimelike input to BooleanArray - #71947

Draft
jbrockmendel wants to merge 1 commit into
pandas-dev:mainfrom
jbrockmendel:boolean-array-not-1d
Draft

jbrockmendel wants to merge 1 commit into
pandas-dev:mainfrom
jbrockmendel:boolean-array-not-1d

Conversation

@jbrockmendel

Copy link
Copy Markdown
Member

Follow-up to GH-71770. pd.array with a 2-D numeric or datetime64 ndarray and dtype="boolean" returned a 2-D BooleanArray, and 0-d input raised a misleading mask should be boolean numpy array:

pd.array(np.array([[0, 1], [1, 0]]), dtype="boolean")  # 2-D BooleanArray

These now raise TypeError: values must be a 1D list-like, as Int64 and Float64 do. A 2-D bool ndarray still returns 2-D, as before. GH-71770 is unreleased, so there is no whatsnew entry.

AI disclosure: drafted with Claude Code (claude opus 5.5 (high)), which found the bug while reviewing GH-71770 and wrote the fix and tests under my direction.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jbrockmendel jbrockmendel added this to the 3.2 milestone Nov 7, 2026
@jbrockmendel jbrockmendel added Bug Constructors Series/DataFrame/Index/pd.array Constructors NA - MaskedArrays Related to pd.NA and nullable extension arrays labels Nov 7, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Constructors Series/DataFrame/Index/pd.array Constructors NA - MaskedArrays Related to pd.NA and nullable extension arrays

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant