You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [17]: df=pd.DataFrame(np.random.randn(100, 4))
In [18]: df.loc[:, 0] =np.nanIn [19]: df.plot(kind='box')
---------------------------------------------------------------------------ValueErrorTraceback (mostrecentcalllast)
<ipython-input-19-06443674b77d>in<module>()
---->1df.plot(kind='box')
/Users/tom/Envs/py3/lib/python3.4/site-packages/pandas/pandas/tools/plotting.pyinplot_frame(frame, x, y, subplots, sharex, sharey, use_index, figsize, grid, legend, rot, ax, style, title, xlim, ylim, logx, logy, xticks, yticks, kind, sort_columns, fontsize, secondary_y, layout, **kwds)
2362secondary_y=secondary_y, layout=layout, **kwds)
2363->2364plot_obj.generate()
2365plot_obj.draw()
2366returnplot_obj.result/Users/tom/Envs/py3/lib/python3.4/site-packages/pandas/pandas/tools/plotting.pyingenerate(self)
913self._compute_plot_data()
914self._setup_subplots()
-->915self._make_plot()
916self._add_table()
917self._make_legend()
/Users/tom/Envs/py3/lib/python3.4/site-packages/pandas/pandas/tools/plotting.pyin_make_plot(self)
2140kwds=self.kwds.copy()
2141->2142ret, bp=plotf(ax, y, column_num=0, **kwds)
2143self.maybe_color_bp(bp)
2144self._return_obj=ret/Users/tom/Envs/py3/lib/python3.4/site-packages/pandas/pandas/tools/plotting.pyinplotf(ax, y, column_num, **kwds)
2059else:
2060y=remove_na(y)
->2061bp=ax.boxplot(y, **kwds)
20622063ifself.return_type=='dict':
/Users/tom/Envs/py3/lib/python3.4/site-packages/matplotlib-1.5.x-py3.4-macosx-10.9-x86_64.egg/matplotlib/axes/_axes.pyinboxplot(self, x, notch, sym, vert, whis, positions, widths, patch_artist, bootstrap, usermedians, conf_intervals, meanline, showmeans, showcaps, showbox, showfliers, boxprops, labels, flierprops, medianprops, meanprops, capprops, whiskerprops, manage_xticks)
3043 """
3044 bxpstats = cbook.boxplot_stats(x, whis=whis, bootstrap=bootstrap,
-> 3045 labels=labels)
3046 if flierprops is None:
3047 flierprops = dict(sym=sym)
/Users/tom/Envs/py3/lib/python3.4/site-packages/matplotlib-1.5.x-py3.4-macosx-10.9-x86_64.egg/matplotlib/cbook.py in boxplot_stats(X, whis, bootstrap, labels)
1963
1964 # medians and quartiles
-> 1965 q1, med, q3 = np.percentile(x, [25, 50, 75])
1966
1967 # interquartile range
/Users/tom/Envs/py3/lib/python3.4/site-packages/numpy/lib/function_base.py in percentile(a, q, axis, out, overwrite_input)
2818 axis = 0
2819
-> 2820 return _compute_qth_percentile(sorted, q, axis, out)
2821
2822 # handle sequence of q's without calling sort multiple times
/Users/tom/Envs/py3/lib/python3.4/site-packages/numpy/lib/function_base.py in _compute_qth_percentile(sorted, q, axis, out)
2824 if not isscalar(q):
2825 p = [_compute_qth_percentile(sorted, qi, axis, None)
-> 2826 for qi in q]
2827
2828 if out is not None:
/Users/tom/Envs/py3/lib/python3.4/site-packages/numpy/lib/function_base.py in <listcomp>(.0)
2824 if not isscalar(q):
2825 p = [_compute_qth_percentile(sorted, qi, axis, None)
-> 2826 for qi in q]
2827
2828 if out is not None:
/Users/tom/Envs/py3/lib/python3.4/site-packages/numpy/lib/function_base.py in _compute_qth_percentile(sorted, q, axis, out)
2854 # Use add.reduce in both cases to coerce data type as well as
2855 # check and use out array.
-> 2856 return add.reduce(sorted[indexer]*weights, axis=axis, out=out)/sumval
2857
2858 def trapz(y, x=None, dx=1.0, axis=-1):
ValueError: operands could not be broadcast together with shapes (0,) (2,)
Same result for df.boxplot().
The text was updated successfully, but these errors were encountered:
Very much an edge case:
Same result for
df.boxplot()
.The text was updated successfully, but these errors were encountered: