Skip to content
Snippets Groups Projects
Commit a06d7bcf authored by Richter, Manuela's avatar Richter, Manuela
Browse files

stored pandas dataframe into hdf5-file

parent 05a5627f
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ testfile for operating with json-files
import json
import numpy as np
import pandas as pd
import h5py as h5
#%% define functions
def findkeys(node, kv):
......@@ -107,3 +108,14 @@ for p in range(0,len(data_pumps)):
dataset.index = ["eta_pumpe","eta_motor","eta_ges"]
count +=1
print(p,m,eta_ges)
#%% store dataframe in hdf5-file
filename = "example_kpi.h5"
with pd.HDFStore(filename, "a") as hdf:
try:
#grp = hdf.create_group("Berechnung")
#grp.create_dataset("Efficiency", data = dataset)
dataset.to_hdf(hdf,"Berechnung")
except ValueError:
print("Gruppe existiert bereits.")
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment