이렇게 한번 해보세요
text = "I have an Apple. I have a Banana. I have an Orange. I have a Watermelon."
words = text.split()
sentences = []
for i in range(0, len(words), 5):
sentence = words[i:i+5]
sentence = ' '.join(sentence)
sentences.append(sentence)
series = pd.Series(sentences)
df = series.to_frame()
df.columns = ['Text']
© 2022 pinfo. All rights reserved.