|
@@ -25,13 +25,17 @@ class FlattenData():
|
|
|
:parm data: data given in either dictionary, list or dataframe format.
|
|
|
'''
|
|
|
|
|
|
- assert(isinstance(data, (list, dict, pd.DataFrame))),\
|
|
|
+ assert(isinstance(data, (list, dict, pd.DataFrame, pd.Series))),\
|
|
|
"Parameter 'data' either be of List, Dictionary or DataFrame type"
|
|
|
in_length=0
|
|
|
start = time.time()
|
|
|
if type(data) is pd.DataFrame:
|
|
|
in_length = len(data.columns)
|
|
|
return_data = self.flatten_dataframe(data)
|
|
|
+ elif type(data) is pd.Series:
|
|
|
+ data = pd.DataFrame(data)
|
|
|
+ in_length = len(data.columns)
|
|
|
+ return_data = self.flatten_dataframe(data)
|
|
|
elif type(data) is dict:
|
|
|
in_length = len(data)
|
|
|
return_data = self.flatten_dict(data)
|