title: Boolean mask used to separate data, but when plotting, matplotlib returns: 'ValueError: The truth value of a DataFrame is ambiguous....'
body: <p>This is a small snippet of my original large (7000+ row) dataframe, indexed by date, with columns for flood size (Size) and precipitation (ppt):</p>
  
  <pre><code>                Size    ppt
  date
  2017-09-11      0.0     0.000000
  2017-09-12      0.0     0.000000
  2017-09-13      0.0     0.000000
  2017-09-14      1.0     34.709998
  2017-09-15      0.0     0.000000
  2017-09-16      0.0     0.000000
  2017-09-17      0.0     0.000000
  2017-09-18      0.0     0.600000
  2017-09-19      3.0     157.439998
  </code></pre>
  
  <p>I have used the code below to split it into groups that I want to compare, which are 'Rainfall on flood days (when Size=1,2 or 3, ppt>=0)', 'Rainfall on days with no floods (Size=0, ppt>0), and then removing the days where no rain or floods happened (Size=0, ppt=0). </p>
  
  <pre><code>#initial separation of data
  
  mask = df1['Size'].eq(0)
  dfFl = df1[~mask] #Days with floods
  dfnFl = df1[mask] #Days without floods i.e Size=0
  
  # remove days with no rain or flood.
  
  mask = df1['ppt3'].eq(0)
  dfnFl = df1[~mask] #Days with rain but no flood
  dfnil = df1[mask] #Days with no flood or rain
  </code></pre>
  
  <p>Using this snippet of my dataframe, this process returns:</p>
  
  <pre><code>#dfFl (days with flood):
                  Size    ppt
  date
  2017-09-14      1.0     34.709998
  2017-09-19      3.0     157.439998
  
  #dfnFl (days with rainfall but no flood):
                  Size    ppt
  date
  2017-09-18      0.0     0.600000
  
  #dfnil (days with no rain nor flood):
                  Size    ppt
  date
  2017-09-11      0.0     0.000000
  2017-09-12      0.0     0.000000
  2017-09-13      0.0     0.000000
  2017-09-15      0.0     0.000000
  2017-09-16      0.0     0.000000
  2017-09-17      0.0     0.000000
  2017-09-18      0.0     0.600000
  </code></pre>
  
  <p>I want to compare these groups (dfFl and dfnFl) by viewing them in a simple box plot:</p>
  
  <pre><code>fig, axs = plt.subplots(2, 3)
  axs[0, 0].boxplot(dfFl['ppt'], dfnFl['ppt'])
  plt.show()
  </code></pre>
  
  <p>However, when I try to do this, I get the following error:</p>
  
  <pre><code>---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-39-2b9c443a4940&gt; in &lt;module&gt;()
        2
        3 fig, axs = plt.subplots(2, 3)
  ----&gt; 4 axs[0, 0].boxplot(dfFl['ppt'], dfnFl['ppt'])
        5 plt.show()
  
  ~/anaconda3/lib/python3.6/site-packages/matplotlib/__init__.py in inner(ax, 
  *args, **kwargs)
     1708                     warnings.warn(msg % (label_namer, func.__name__),
     1709                                   RuntimeWarning, stacklevel=2)
  -&gt; 1710             return func(ax, *args, **kwargs)
     1711         pre_doc = inner.__doc__
     1712         if pre_doc is None:
  
  ~/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py in 
  boxplot(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, autorange, zorder)
     3443                            meanline=meanline, showfliers=showfliers,
     3444                            capprops=capprops, whiskerprops=whiskerprops,
  -&gt; 3445                            manage_xticks=manage_xticks, zorder=zorder)
     3446         return artists
     3447 
  
  ~/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py in bxp(self, 
  bxpstats, positions, widths, vert, patch_artist, shownotches, showmeans, 
  showcaps, showbox, showfliers, boxprops, whiskerprops, flierprops, medianprops, 
  capprops, meanprops, meanline, manage_xticks, zorder)
     3773 
     3774             # notched boxes
  -&gt; 3775             if shownotches:
     3776                 box_x = [box_left, box_right, box_right, cap_right, 
  box_right,
     3777                          box_right, box_left, box_left, cap_left, 
  box_left,
  
  ~/anaconda3/lib/python3.6/site-packages/pandas/core/generic.py in 
  __nonzero__(self)
      953         raise ValueError("The truth value of a {0} is ambiguous. "
      954                          "Use a.empty, a.bool(), a.item(), a.any() or 
  a.all()."
  --&gt; 955                          .format(self.__class__.__name__))
      956 
      957     __bool__ = __nonzero__
  ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), 
  a.item(), a.any() or a.all().
  </code></pre>
  
  <p>I don't really understand what is going wrong here, as when I view the filtered dataframes, they look normal (as shown above). Any ideas out there?</p>
  
  <p>Thanks</p>