Pandas Data Frame to_csv with more separator
问题 I have a file of 40 columns and 600 000 rows. After processing it in pandas dataframe, i would like to save the data frame to csv with different spacing length. There is a sep kwarg in df.to_csv, i tried with regex, but i'm getting error TypeError: "delimiter" must be an 1-character string. I want the output with different column spacing, as shown below A B C D E F G 1 3 5 8 8 9 8 1 3 5 8 8 9 8 1 3 5 8 8 9 8 1 3 5 8 8 9 8 1 3 5 8 8 9 8 Using the below code i'm getting the tab delimited. which