I have a txt file with numerical data, a header, and a row with column names.
I read it as follows:
a = ["Radius (m)", "n" ,"wg_w (m)" ,"lambda (GHz)" , "real(freq) (1/s)" , "imag(freq) (1/s)" , "Azmiuthal mode number" ,"Quality factor (1)", "_Radius (m)" , "IntEDx_wg (J)", "IntEDx_all (J)" , "IntED_wg (J)" ,"IntED_all (J)" , "Reff (m)" ,"neff (rad)"
]
df = pd.read_csv(r"results.txt", delim_whitespace=True, comment="%",header=4,names=a,float_precision='high')
But when I print(df)
I get the df with different order of rows.
In this post I saw that it can happen when one creates df with a dictionary, but I’m not using dictionaries here. So why does it happen?