Commit 70f50136 by arun.uday

updated access_operations.py

app_class_operations.py
pivoted_data_frames.py
to include pivoted data as their dataframe
parent 1e967cbf
......@@ -20,4 +20,4 @@ def pivot_frame(file):
body_vals = {"body": pivoted_d.to_dict(orient="records")}
dict_new = {**head_cols, **body_vals}
return dict_new
return dict_new, pivoted_d
......@@ -17,15 +17,15 @@ def access_op():
json_pandas.create_json(path_time, time_changed)
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)
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)
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)
except Exception as e:
......
......@@ -53,11 +53,11 @@ class JsonPandas:
@staticmethod
def pivot_data(file):
try:
data_pivoted = pivot_frame(file)
dict_data_pivoted, data_pivoted = pivot_frame(file)
except Exception as e:
print(f'{exception_msg}{e}')
else:
return data_pivoted
return dict_data_pivoted, data_pivoted
# using the melt function
@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