Browse Source

Add method to flattendata

ogert 4 years ago
parent
commit
b994825cf6
1 changed files with 10 additions and 1 deletions
  1. 10 1
      cdplib/FlattenData.py

+ 10 - 1
cdplib/FlattenData.py

@@ -170,4 +170,13 @@ class FlattenData():
         for key in to_append:
             dictionary[key] = to_append[key]
 
-        return dictionary
+        return dictionary
+
+    def flatten_if_not_flat(self, data: pd.DataFrame):
+
+        for data_type in data.dtypes:
+                if data_type == object:
+                    return self.flatten(data) 
+
+        return data   
+