From e0a40bae013a4904e5d35524b639511f90a5ba93 Mon Sep 17 00:00:00 2001 From: Sebastian Kloth Date: Sat, 27 Jan 2024 14:51:19 +0100 Subject: [PATCH] Started example for data management calculations --- examples/data_management.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 examples/data_management.py diff --git a/examples/data_management.py b/examples/data_management.py new file mode 100644 index 0000000..769db88 --- /dev/null +++ b/examples/data_management.py @@ -0,0 +1,15 @@ +DATA_DIR = "/data/skloth/results/workshop_data" +np.save(f"{DATA_DIR}/msd.npy", result_msd_nojump) +print(np.load(f"{DATA_DIR}/msd.npy")) + +import pandas as pd +msd_df = pd.DataFrame({"t": result_msd[0], "msd_water": result_msd[1]}) +print(msd_df) +msd_df["T"] = 300 +msd_df["cation"] = "C4mim" +msd_df["anion"] = "DCA" +print(msd_df) +msd_df.to_hdf(f"{DATA_DIR}/result.h5", key="msd") +msd_df = pd.read_hdf(f"{DATA_DIR}/result.h5", key="msd") +print(msd_df.info()) +md.utils.cleanup_h5(f"{DATA_DIR}/result.h5") \ No newline at end of file