title: write a Pandas dataframe to a .txt file
body: <p>My code writes a txt file with lots of data. I'm trying to print a pandas dataframe into that txt file as part of my code but can't use .write() as that only accepts strings. </p>
  
  <p>How do I take a pandas dataframe, stored as DF1 for example, and print it in the file? </p>
  
  <p>I've seen similar questions but those are aimed at creating a txt file solely for the dataframe, I would just like my dataframe to appear in a txt file</p>