I'm pretty new importing data and I´m trying to make def that reads in the presented order. The error is in the fuction, not in the data.
def read_eos(filename: str, order: dict[str, int] = {"density": 0, "pressure": 1,
"energy_density": 2}):
# Paths to files
current_dir = os.getcwd()
INPUT_PATH = os.path.join(current_dir, "input")
in_eos = np.loadtxt(os.path.join(INPUT_PATH, filename))
eos = np.zeros(in_eos.shape)
# Density
eos[:, 0] = in_eos[:, order["density"]]
eos[:, 1] = in_eos[:, order["pressure"]]
eos[:, 2] = in_eos[:, order["energy_density"]]
return eos