this question has been ask couple of times but none of the answer is working for that what I want.

For example I have this excel Dokument:

Numbers  Names  Address 
1        Ben    Street1
2        Anna   Street2
3        Tom    Street3

Now I want to store only the column Names into one string:

string_text = "Ben Anna Tom"
print(string_text)-> Ben Anna Tom

I tried this out:

string_text = str(df['Names'].values)
print (text)

and I get:


Is there any option I can get really only the value of each cell and concatenate them together without the apostrophes in between?


1 Answer 1


If you are looking to create a list then you can use:


If you are looking to create a long string use join (you can of course choose any delimiter you like):

' '.join(df['Names'].values[1:])
  • $\begingroup$ if I do so, I will get a String where every char is separated and I still have the apostrophes. $\endgroup$
    – Loretta
    Nov 25, 2020 at 9:35
  • $\begingroup$ and if I use to_string its truncates the strings of the cells $\endgroup$
    – Loretta
    Nov 25, 2020 at 10:01
  • $\begingroup$ To get rid of the apostrophes use: print(' '.join(df['Names'].values)) $\endgroup$ Jan 25, 2021 at 19:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.