add a string prefix to each value in a string column using Pandas

I would like to append a string to the start of each value in a said column of a pandas dataframe (elegantly). I already figured out how to kind-of do this and I am currently using:

    df.ix[(df['col'] != False), 'col'] = 'str'+df[(df['col'] != False), 'col']

This seems one hell of an inelegant thing to do - do you know any other way (which maybe also adds the character to rows where that column is 0 or NaN)?

In case this is yet unclear, I would like to turn:

        col 
    1     a
    2     0

into:

           col 
    1     stra
    2     str0
    df['col'] = 'str' + df['col'].astype(str)

Example:

    >>> df = pd.DataFrame({'col':['a',0]})
    >>> df
      col
    0   a
    1   0
    >>> df['col'] = 'str' + df['col'].astype(str)
    >>> df
        col
    0  stra
    1  str0

From: stackoverflow.com/q/20025882

Back to homepage or read more recommendations: