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

Function save_data_frame

experiments/python/pyience.py:111–117  ·  view source on GitHub ↗
(df, save_dir, name=None, timestamp=False)

Source from the content-addressed store, hash-verified

109
110
111def save_data_frame(df, save_dir, name=None, timestamp=False):
112 ensure_dir_exists(save_dir)
113 timestamp_str = ("_" + now_as_string()) if timestamp else ""
114 name = name if name else ""
115 fileName = "{}{}.csv".format(name, timestamp_str)
116 df = df.sort_index(axis=1)
117 df.to_csv(os.path.join(save_dir, fileName))
118
119
120def save_dicts_as_data_frame(d, save_dir, name=None, timestamp=False):

Callers 1

save_dicts_as_data_frameFunction · 0.85

Calls 3

ensure_dir_existsFunction · 0.90
now_as_stringFunction · 0.85
formatMethod · 0.80

Tested by

no test coverage detected