I am trying to save each row in my dataframe to a separate txt-file, with the content in one of the columns named after the other column. I got it to work but it only saves 4445 rows out of 46000. Any suggestions on what I could be doing wrong?
This is the code i am using:
file = 'Test_dir/{}.txt'
for i in df.index:
content = df["content"][i]
name = df["name"][i]
with open(file.format(name), "w") as f:
f.write(content)