Фон
У меня есть следующий образец df
:
import pandas as pd
df = pd.DataFrame({'Before' : [['there, are, many, different'],
['i, like, a, lot, of, sports '],
['the, middle, east, has, many']],
'After' : [['in, the, bright, blue, box'],
['because, they, go, really, fast'],
['to, ride, and, have, fun'] ],
'P_ID': [1,2,3],
'Word' : ['crayons', 'cars', 'camels'],
'N_ID' : ['A1', 'A2', 'A3']
})
выход
After Before N_ID P_ID Word
0 [in, the, bright, blue, box] [there, are, many, different] A1 1 crayons
1 [because, they, go, really,fast] [i, like, a, lot, of, sports ] A2 2 cars
2 [to, ride, and, have, fun] [the, middle, east, has, many] A3 3 camels
Желаемый выход
After Before N_ID P_ID Word
0 in the bright blue box there are many different A1 1 crayons
1 because they go really fast i like a lot of sports A2 2 cars
2 to ride and have fun the middle east has many A3 3 camels
Вопрос
Как получить желаемый результат, который 1) не указан и 2) удалены запятые?
Я пытался Удаление списков из каждой ячейки в панде dataframe безрезультатно