title: ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()
body: <p>I try to forward a data to excel but received the subject error.</p>
  
  <p>I want to combine some of excel files into one excel file. First I created all_info array in order to collect all data into. </p>
  
  <pre><code>all_info = []
  </code></pre>
  
  <p>After that I read every excel files. Excel files follows; sample1, sample2, and so on.</p>
  
  <pre><code>data = pd.read_excel('sample1.xlsx', 'Sheet1')
  </code></pre>
  
  <p>I add each excel files' data into all_info array with below.</p>
  
  <pre><code>for i in range(0, len(data)):
      all_info.append(data)
  </code></pre>
  
  <p>After I combine all data within all_info array, I executed below code but received the subject error. </p>
  
  <pre><code>df = pd.DataFrame(all_info)
  df.to_excel("all_info.xlsx")
  </code></pre>
  
  <p>You may see error details below. </p>
  
  <pre><code>ValueError                                Traceback (most recent call last)
  &lt;ipython-input-85-5bff7d788042&gt; in &lt;module&gt;()
    1 df = pd.DataFrame(all_tweets)
  ----&gt; 2 df.to_excel("all_info.xlsx")
  
   /usr/lib/python2.7/dist-packages/pandas/core/frame.pyc in to_excel(self, excel_writer, sheet_name, na_rep, float_format, cols, header, index, index_label, startrow, startcol, engine, merge_cells)
  1202         formatted_cells = formatter.get_formatted_cells()
  1203         excel_writer.write_cells(formatted_cells, sheet_name,
  -&gt; 1204                                  startrow=startrow, startcol=startcol)
  1205         if need_save:
  1206             excel_writer.save()
  
  /usr/lib/python2.7/dist-packages/pandas/io/excel.pyc in write_cells(self, cells, sheet_name, startrow, startcol)
  525             colletter = get_column_letter(startcol + cell.col + 1)
  526             xcell = wks.cell("%s%s" % (colletter, startrow + cell.row + 1))
  --&gt; 527             xcell.value = _conv_value(cell.val)
  528             style = None
  529             if cell.style:
  
  /usr/lib/pymodules/python2.7/openpyxl/cell.pyc in _set_value(self, value)
  339     def _set_value(self, value):
  340         """Set the value and infer type and display options."""
  --&gt; 341         self.bind_value(value)
  342 
  343     value = property(_get_value, _set_value,
  
  /usr/lib/pymodules/python2.7/openpyxl/cell.pyc in bind_value(self, value)
  278     def bind_value(self, value):
  279         """Given a value, infer type and display options."""
  --&gt; 280         self._data_type = self.data_type_for_value(value)
  281         if value is None:
  282             self.set_value_explicit('', self.TYPE_NULL)
  
  /usr/lib/pymodules/python2.7/openpyxl/cell.pyc in data_type_for_value(self, value)
  260         elif isinstance(value, (datetime.datetime, datetime.date, datetime.time, datetime.timedelta)):
  261             data_type = self.TYPE_NUMERIC
  --&gt; 262         elif not value:
  263             data_type = self.TYPE_STRING
  264         elif isinstance(value, basestring) and value[0] == '=':
  
  /usr/lib/python2.7/dist-packages/pandas/core/generic.pyc in __nonzero__(self)
  674         raise ValueError("The truth value of a {0} is ambiguous. "
  675                          "Use a.empty, a.bool(), a.item(), a.any() or a.all()."
  --&gt; 676                          .format(self.__class__.__name__))
  677 
  678     __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>