diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/DataStructures.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/argaze/DataStructures.py b/src/argaze/DataStructures.py index 7fb8cd8..fcd91e1 100644 --- a/src/argaze/DataStructures.py +++ b/src/argaze/DataStructures.py @@ -232,24 +232,27 @@ class TimeStampedBuffer(collections.OrderedDict): df.drop(exclude, inplace=True, axis=True) # Split columns - splited_columns = [] - for column in df.columns: + if len(split) > 0: - if column in split.keys(): + splited_columns = [] + + for column in df.columns: + + if column in split.keys(): - df[split[column]] = pandas.DataFrame(df[column].tolist(), index=df.index) - df.drop(column, inplace=True, axis=True) + df[split[column]] = pandas.DataFrame(df[column].tolist(), index=df.index) + df.drop(column, inplace=True, axis=True) - for new_column in split[column]: + for new_column in split[column]: - splited_columns.append(new_column) + splited_columns.append(new_column) - else: + else: - splited_columns.append(column) + splited_columns.append(column) - # Reorder splited columns - df = df[splited_columns] + # Reorder splited columns + df = df[splited_columns] # Append timestamps as index column df['timestamp'] = self.keys() |