how to add string to all values of column in pandas

Solutions on MaxInterview for how to add string to all values of column in pandas by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "how to add string to all values of column in pandas"
Camila
11 May 2018
1>>> df = pd.DataFrame({'col':['a',0]})
2>>> df
3  col
40   a
51   0
6>>> df['col'] = 'str' + df['col'].astype(str)
7>>> df
8    col
90  stra
101  str0
11