So I have like 20,000 rows in a single column in Excel that contains all text. I'm trying to combine all the rows into a single cell that I call 'message' so then I can do some stuff in TextBlob, like count the number of sentences, but I'm not having any success combining all the text rows into one.
input (cant seem to copy and paste but formatted as a single column)
MsgBody
sure can
race game
like one of the biggest games
desired output:
sure can, race game, like one of the biggest games
actual output:
sure can
import csv
from textblob import TextBlob
import pandas as pd
input_csv = pd.read_csv(r'output.csv')
messages = input_csv['MsgBody']
allMessages = []
for message in messages:
allMessages.append(message)
allMessages = list(messages)
'\n'.join(messages)
or something like that? What exactly do you mean by "combine all the rows into a single cell"?