I have a dataframe (let's call it df) that has a column (let's call it A
).
Column A has the description value that has text (multiple sentences).
I want to write the text into a text file (text.txt) such that each line has just one sentence.
So, I want to split the contents of column A by full stop(.) and question mark(?) and write them into a text file for each row. All the sentences from column A will be in 1 file, so text.txt should iteratively append sentences for each row
This is what I have so far, I have split the column into list of sentences
import numpy as np
df['A'] = df['A'].apply(lambda x : str(x).split("."))
#np.savetxt('text.txt', A.values)
but I m not sure, how to proceed further, Can someone help?