Closed
Description
Bug report
Bug summary
boxplot
is calling asarray
on lists of arrays they do not have the same shape. In future NumPy ragged array construction will raise an error unless dtype='object' is explicitly passed.
This issue happens in
matplotlib/lib/matplotlib/cbook/__init__.py
Line 1382 in c0bf2ef
Code for reproduction
import numpy as np
import matplotlib.pyplot as plt
x = [np.random.standard_normal(v) for v in np.random.randint(100,200,5)]
plt.boxplot(x)
You need NumPy 1.19dev0 to see this warning.
Actual outcome
numpy.VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
Expected outcome
No warning
Matplotlib version
- Operating system: Ubuntu 18.04
- Matplotlib version: 3.2.0rc2+1221.g20805b805
- Matplotlib backend (
print(matplotlib.get_backend())
): agg - Python version: 3.8.0
- Jupyter version (if applicable):
- Other libraries: numpy: 1.19.0.dev0+32aa66e
This is on a statsmodels "pre" build that uses the latest nightlies on rackcdn.