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 currentl
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