Skip to content

Commit 373e75b

Browse files
add conditional to check ndim
1 parent 644a335 commit 373e75b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/construction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def array(
306306
raise TypeError("Cannot pass DataFrame to 'pandas.array'")
307307
elif isinstance(data, np.ndarray):
308308
if data.ndim != 1:
309-
raise TypeError("values must be a 1D list-like")
309+
raise ValueError("NumpyExtensionArray must be 1-dimensional")
310310

311311
if dtype is None and isinstance(data, (ABCSeries, ABCIndex, ExtensionArray)):
312312
# Note: we exclude np.ndarray here, will do type inference on it

0 commit comments

Comments
 (0)