import pandas as pd

df = pd.read_csv("10XDES.FITRES", comment="#", sep=r'\s+')

# Keep 2/3 of the rows (drop 1/3 randomly)
df_sampled = df.sample(frac=0.5, random_state=42)

df_sampled.to_csv("5XDES.FITRES", index=False, sep=' ')
