We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c06ba77 commit 73ab7faCopy full SHA for 73ab7fa
lib/matplotlib/cbook/__init__.py
@@ -1333,7 +1333,16 @@ def _reshape_2D(X, name):
1333
*name* is used to generate the error message for invalid inputs.
1334
"""
1335
# Iterate over columns for ndarrays, over rows otherwise.
1336
- X = np.atleast_1d(X.T if isinstance(X, np.ndarray) else np.asarray(X))
+ if isinstance(X, np.ndarray):
1337
+ X = X.T
1338
+ else:
1339
+ try:
1340
+ X = np.asarray(X)
1341
+ except np.VisibleDeprecationWarning:
1342
+ # NumPy 1.19 does not allow implicit ragged-array conversion,
1343
+ # but callers to this function do.
1344
+ X = np.asarray(X, dtype=object)
1345
+ X = np.atleast_1d(X)
1346
if len(X) == 0:
1347
return [[]]
1348
elif X.ndim == 1 and np.ndim(X[0]) == 0:
0 commit comments