title: Iterate over columns in a pandas dataframe and output result into a new dataframe
body: <p>I'm trying to iterate over the columns in a pandas dataframe that is 6 x 22 columns using <code>df.apply(min_max, axis=0)</code> and get the output in a new dataframe with two columns as below.</p>
  <pre><code>   def min_max(column):
        column_names = ['column', 'value']
        output = pd.DataFrame(columns = column_names)
        output2 = pd.DataFrame([column, abs(column.max() - column.min())])
        return output.append(output2)
  </code></pre>
  <p>df is shown in attached img: <a href="https://i.stack.imgur.com/9YI02.png" rel="nofollow noreferrer">first few columns on current dataframe</a></p>
  <p>Two questions:</p>
  <ol>
  <li><p>I'm getting the error below:</p>
  <p>TypeError: (&quot;object of type 'Timedelta' has no len()&quot;, 'occurred at index date')</p>
  </li>
  <li><p>Is there a way I can exclude all
  columns that are not <code>dtype = int</code>? Does this go into the function?</p>
  </li>
  </ol>
  <p>Much oblidged.</p>