I want to take input in the form of lists and join them into strings. How I can store the output as a dataframe column?
The input X
is a dataframe and the column name is des
:
X['des'] =
[5, 13]
[L32MM, 4MM, 2]
[724027, 40]
[58, 60MM, 36MM, 0, 36, 3]
[8.5, 45MM]
[5.0MM, 44MM]
[10]
This is my code:
def clean_text():
for i in range(len(X)):
str1 = " "
print(str1.join(X['des'][i]))
m = clean_text
m()
And here is my output, but how I can make it as a dataframe?
5 13
L32MM 4MM 2
724027 40
58 60MM 36MM 0 36 3
8.5 45MM
5.0MM 44MM
10