title: Loop for min/max column values using pandas dataframe?
body: <p>How can I best get the min/max column values in a pandas dataframe? Specifically, I'm looking to get the <em>min/max values for the lengths of the strings,</em> and take some action based off those values. </p>
  
  <p>I can do this for individual columns but I'd rather loop over all the required columns than complete the tasks as one-offs.</p>
  
  <p>Here is my one off code which works but there has to be a better way, IMO:</p>
  
  <pre><code>cols = ['STORE_NO', 'SKU']
      for name in cols:
          inventory_df[name] = inventory_df[name].astype(str)
          long_store = inventory_df.STORE_NO.map(len).max()
          small_store = inventory_df.STORE_NO.map(len).min()
          if long_store == small_store:
              print('Store number values do not appear truncated')
          else:
              print('Some store number values may be truncated')
  
          long_sku = inventory_df.SKU.map(len).max()
          small_sku = inventory_df.SKU.map(len).min()
          if long_sku == small_sku:
              print('SKU values do not appear truncated')
          else:
              print('Some SKU values may be truncated')     
  </code></pre>