MCPcopy Create free account
hub / github.com/dblalock/bolt / save_dicts_as_data_frame

Function save_dicts_as_data_frame

experiments/python/pyience.py:120–129  ·  view source on GitHub ↗
(d, save_dir, name=None, timestamp=False)

Source from the content-addressed store, hash-verified

118
119
120def save_dicts_as_data_frame(d, save_dir, name=None, timestamp=False):
121 if not isinstance(d, dict):
122 try:
123 df = pd.DataFrame.from_records(d)
124 except:
125 dfs = [pd.DataFrame.from_records(dd, index=[0]) for dd in d]
126 df = pd.concat(dfs, axis=0, ignore_index=True)
127 else:
128 df = pd.DataFrame.from_records(d, index=[0])
129 save_data_frame(df, save_dir, name=name, timestamp=timestamp)
130
131
132def generate_save_path(params, savedir, subdir_keys=None):

Callers

nothing calls this directly

Calls 1

save_data_frameFunction · 0.85

Tested by

no test coverage detected