title: "transpose" a Pandas Series
body: <p>I have a DataFrame with an ID column and some features columns. I'd like to see a description of how many unique IDs are there per column values. </p>
  
  <p>The following code works but I wonder if there a better way than the <code>to_frame().unstack().unstack()</code> line which transposes the <code>.describe()</code> series result to DataFrame where the columns are the percentiles, max, min ...</p>
  
  <pre><code>def unique_ids(df):
      rows = []
      for col in sorted(c for c in df.columns if c != id_col):
          v = df.groupby(col)[id_col].nunique().describe()
          v = v.to_frame().unstack().unstack()  # Transpose
          v.index = [col]
          rows.append(v)
  
      return pd.concat(rows)
  </code></pre>