Commit 5ad85be7 by arun.uday

Merge remote-tracking branch 'origin/master'

parents 93386271 70f50136
...@@ -20,4 +20,4 @@ def pivot_frame(file): ...@@ -20,4 +20,4 @@ def pivot_frame(file):
body_vals = {"body": pivoted_d.to_dict(orient="records")} body_vals = {"body": pivoted_d.to_dict(orient="records")}
dict_new = {**head_cols, **body_vals} dict_new = {**head_cols, **body_vals}
return dict_new return dict_new, pivoted_d
...@@ -17,15 +17,15 @@ def access_op(): ...@@ -17,15 +17,15 @@ def access_op():
json_pandas.create_json(path_time, time_changed) json_pandas.create_json(path_time, time_changed)
print("Pivoting the dataframe") print("Pivoting the dataframe")
pivot_change = json_pandas.pivot_data(file_concat) dict_data_pivoted, pivot_change = json_pandas.pivot_data(file_concat)
json_pandas.create_json(path_pivot, pivot_change) json_pandas.create_json(path_pivot, pivot_change)
print("Melting the dataframe") print("Melting the dataframe")
melt_change = json_pandas.melt_data(file_concat) melt_change = json_pandas.melt_data(dict_data_pivoted)
json_pandas.create_json(path_melt, melt_change) json_pandas.create_json(path_melt, melt_change)
print("Merging the dataframe") print("Merging the dataframe")
merge_change = json_pandas.merge_data(file_concat) merge_change = json_pandas.merge_data(dict_data_pivoted)
json_pandas.create_json(path_merge, merge_change) json_pandas.create_json(path_merge, merge_change)
except Exception as e: except Exception as e:
......
...@@ -53,11 +53,11 @@ class JsonPandas: ...@@ -53,11 +53,11 @@ class JsonPandas:
@staticmethod @staticmethod
def pivot_data(file): def pivot_data(file):
try: try:
data_pivoted = pivot_frame(file) dict_data_pivoted, data_pivoted = pivot_frame(file)
except Exception as e: except Exception as e:
print(f'{exception_msg}{e}') print(f'{exception_msg}{e}')
else: else:
return data_pivoted return dict_data_pivoted, data_pivoted
# using the melt function # using the melt function
@staticmethod @staticmethod
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment