|
@@ -20,7 +20,7 @@ class FlattenData():
|
|
def __init__(self):
|
|
def __init__(self):
|
|
self._log = Log("Flatten data")
|
|
self._log = Log("Flatten data")
|
|
|
|
|
|
- def flatten(self, data):
|
|
|
|
|
|
+ def flatten(self, data) -> pd.DataFrame():
|
|
'''
|
|
'''
|
|
:parm data: data given in either dictionary, list or dataframe format.
|
|
:parm data: data given in either dictionary, list or dataframe format.
|
|
'''
|
|
'''
|
|
@@ -40,7 +40,7 @@ class FlattenData():
|
|
return None
|
|
return None
|
|
|
|
|
|
result_dataframe = pd.DataFrame.from_dict(return_data, orient='index')
|
|
result_dataframe = pd.DataFrame.from_dict(return_data, orient='index')
|
|
- self._log.info(('Data has been flattened, created {} columns in {} seconds').format(len(return_data.columns)- len(data.columns), time.time()-start))
|
|
|
|
|
|
+ self._log.info(('Data has been flattened, created {} columns in {} seconds').format(len(result_dataframe.columns)- len(data.columns), time.time()-start))
|
|
return result_dataframe
|
|
return result_dataframe
|
|
|
|
|
|
def flatten_dataframe(self, dataframe: pd.DataFrame, incoming_key: str = None):
|
|
def flatten_dataframe(self, dataframe: pd.DataFrame, incoming_key: str = None):
|