pandas to text code example
Example 1: save df to txt
df.to_csv(r'c:\data\pandas.txt', header=None, index=None, sep='\t', mode='a')
Example 2: to text pandas
You can use pandas.DataFrame.to_csv(), and setting both index and header to False:
df.to_csv(r'c:\data\pandas.txt', header=None, index=None, sep='\t', mode='a')
You can use pandas.DataFrame.to_csv(), and setting both index and header to False: