title: Converting a pandas series output to string
body: <p>I am trying to convert the output of a query in pandas from the format of a series to the format of a string.
  The function is below (Gold* are columns)</p>
  
  <pre><code>def try_three():
      import numpy as np
      nz=df[(df["Gold"]&gt;0) &amp; (df["Gold.1"]&gt;0) &amp; (df["Gold.2"]&gt;0)]
      nz["average"]=((nz["Gold"])-(nz["Gold.1"]))/(nz["Gold.2"])
      return nz.where(nz["average"]==np.max(nz["average"])).dropna()["ID"]
  </code></pre>
  
  <p>The output is </p>
  
  <pre><code>Country
  Bulgaria    BUL
  Name: ID, dtype: object
  </code></pre>
  
  <p>where Country is the name of the index and BUL is the value of the ID field.
  I have already tried to append .astype(str) to get just the name of the country or the ID, but with no success. If I prepend "len" I get the answer 1, so I think there is something similar and just as simple to get the output as a string.</p>