title: Aggregating DataFrame string columns expected to be the same
body: <p>I am calling <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.agg.html" rel="nofollow noreferrer"><code>DataFrame.agg</code></a> on a dataframe with various numeric and string columns. For string columns, I want the result of the aggregation to be (a) the value of an arbitrary row <em>if</em> every row has that same string value or (b) an error otherwise.</p>
  <p>I could write a custom aggregation function to do this, but is there a canonical way to approach this?</p>