Python 3.x 将数据帧打印到文本文件(Python 3)

Python 3.x 将数据帧打印到文本文件(Python 3),python-3.x,pandas,Python 3.x,Pandas,我有一个像这样的大数据文件 Words One Two Three .... Threethousand 我正在尝试使用以下代码将此列表打印到文本文件: df1 = df[['Words']] with open('atextfile.txt', 'w', encoding='utf-8') as outfile: print(df1, file=outfile) 但结果是它没有打印出整个DF,结果是这样的: Words One Two Three

我有一个像这样的大数据文件

 Words
 One
 Two
 Three
 ....
 Threethousand
我正在尝试使用以下代码将此列表打印到文本文件:

 df1 = df[['Words']]
 with open('atextfile.txt', 'w', encoding='utf-8') as outfile:
         print(df1, file=outfile)
但结果是它没有打印出整个DF,结果是这样的:

 Words
 One
 Two
 Three
 ....
 Threethousand
 Fourthousand
 Fivethousand

如何打印整个DF?

我会使用
来实现这一点,它不像打印那样缩写:

df['Words'].to_string('atextfile.txt')
# or
df[['Words']].to_string('atextfile.txt')