title: Column-slicing method that works on both numpy arrays and pandas dataframes
body: <h2>Example Problem</h2>
  
  <p>Suppose that I have to write a function that returns the first column of a datatable object, but that I don't know in advance whether this object will be a numpy 2D-array or a pandas 2D-dataframe.</p>
  
  <h2>Tried thus far</h2>
  
  <p>The following function works for numpy arrays, but not for pandas dataframes:</p>
  
  <pre><code>def get_first_column(array_or_dataframe):
      return array_or_dataframe[:, 0]
  </code></pre>
  
  <p>The following function works for pandas dataframes, but not for numpy arrays:</p>
  
  <pre><code>def get_first_column(array_or_dataframe):
      return array_or_dataframe.iloc[:, 0]
  </code></pre>
  
  <h2>Summary</h2>
  
  <p>Is it possible to write a single expression for column-slicing that works on both numpy arrays and pandas dataframes?</p>