From 4c0bf17ab0406f5441234dbc4584f2b680d068bc Mon Sep 17 00:00:00 2001 From: eapframework <61295496+eapframework@users.noreply.github.com> Date: Sun, 1 Mar 2020 20:37:28 -0600 Subject: [PATCH] Create exceltojson --- optimus/exceltojson | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 optimus/exceltojson diff --git a/optimus/exceltojson b/optimus/exceltojson new file mode 100644 index 00000000..6a5f1367 --- /dev/null +++ b/optimus/exceltojson @@ -0,0 +1,7 @@ +df_pandas_grped = pdf.groupby('Input_file') +final_dict = {} +for key, grp in df_pandas_grped: + final_dict[str(key)] = grp.to_dict('records') + +with open("/dbfs/FileStore/tables/jsaonoutput.json",'w')as f: + f.write(json.dumps(final_dict,indent=4))