Я хочу объединить две строки в DataFrame в одну строку. Мой текущий код:
import pandas as pd
df = pd.DataFrame(columns = ['string1', 'string2'])
df.loc[len(df), :] = ['Hello', 'This is Sam']
df.loc[len(df), :] = ['how are you?', 'from Canada']
#create the next row: ['Hello how are you?', 'This is Sam from Canada']
Как это сделать?
Вы можете проверить код здесь .