I have a .txt file, without header. I am going to separate into two column with header X and Y that is ordered like this:
I have read text file into pandas:
How can I have data frame with two column and header X and Y?
df = pd.read_csv( "reference.txt", delim_whitespace=True, # any whitespace separates data names=["x", "y"], # column names index_col=False, # no index )
ought to do the trick.