Reputation: 4584
I have dataframe consisting a column of strings.
intcontn1 = [1,2,3,4]
df =
data1 data2 ... data5 test
2019-09-26 14:53:00 72.847746 6.134 ... 24.175877 intcontn1
2019-09-26 16:13:00 76.124547 3.426 ... 39.138517 intcontn1
2019-09-26 16:53:00 77.714545 1.984 ... 39.868317 intcontn1
print(df['test'].tolist())
['intcontn1', 'intcontn1', 'intcontn1']
This looks fine but I want to print without quotes something like this below
print(df['test'].tolist())
[intcontn1,intcontn1,intcontn1]
How to get this?
Upvotes: 0
Views: 198
Reputation: 1368
Do you mean you want to print without the apostrophes ('
)? If so, you could explicitly convert the list to a string and replace()
the apostrophes with a blank string:
print(str(df['test'].tolist()).replace("'", ""))
[intcontn1, intcontn1, intcontn1]
Upvotes: 2