ValueError: min() arg is an empty sequence - Exploratory analysis

3.8k views Asked by At

Need help. I am working on an assignment where i need to do n exploratory data analysis.

I have installed seaborn. While plotting the chart with code lines below

chart1 = sns.catplot(x = "JUNCTIONTYPE", data = df3, kind = "count",  col= "SEVERITYDESC")
chart1.set_xticklabels(rotation=35, horizontalalignment='right')

I am getting the follwing error.


ValueError                                Traceback (most recent call last)
<ipython-input-30-d7f0b1b2a27f> in <module>
----> 1 chart1 = sns.catplot(x = "JUNCTIONTYPE", data = df3, kind = "count",  col= "SEVERITYDESC")
      2 chart1.set_xticklabels(rotation=35, horizontalalignment='right')

~/conda/envs/python/lib/python3.6/site-packages/seaborn/categorical.py in catplot(x, y, hue, data, row, col, col_wrap, estimator, ci, n_boot, units, order, hue_order, row_order, col_order, kind, height, aspect, orient, color, palette, legend, legend_out, sharex, sharey, margin_titles, facet_kws, **kwargs)
   3722     # so we need to define ``palette`` to get default behavior for the
   3723     # categorical functions
-> 3724     p.establish_colors(color, palette, 1)
   3725     if kind != "point" or hue is not None:
   3726         palette = p.colors

~/conda/envs/python/lib/python3.6/site-packages/seaborn/categorical.py in establish_colors(self, color, palette, saturation)
    313         # Determine the gray color to use for the lines framing the plot
    314         light_vals = [colorsys.rgb_to_hls(*c)[1] for c in rgb_colors]
--> 315         lum = min(light_vals) * .6
    316         gray = mpl.colors.rgb2hex((lum, lum, lum))
    317 

ValueError: min() arg is an empty sequence

Similar error for the below code also. Not sure what i am missing. Please help.

chart = sns.catplot(x = "COLLISIONTYPE", data = df3, kind = "count",  col= "SEVERITYDESC")
chart.set_xticklabels(rotation=65, horizontalalignment='right')
1

There are 1 answers

3
Francisco Perdigon Romero On

That seems a bug on seaborn v 0.11.0 I solved it by downgrading it to v 0.10.1

if you are using conda:

conda remove seaborn
conda install seaborn==0.10.1

if you rather pip:

pip uninstall seaborn
pip install seaborn==0.10.1