Using this question: Pandas writing dataframe to CSV file as a model, I wrote the following code to make a csv file:
df.to_csv('/Users/Lab/Desktop/filteredwithheading.txt', sep='\s+', header=True)
But it returns the following error:
TypeError: "delimiter" must be an 1-character string
I have looked up the documentation for this here http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_csv.html but I can't figure out what I am missing, or what that error means. I also tried using (sep='\s') in the code, but got the same error.