Avoid re-creating an entire dataframe when appending
This commit is contained in:
parent
f2caf876a6
commit
42ad42f449
3 changed files with 3 additions and 3 deletions
|
@ -49,7 +49,7 @@ class CpuTimeDataModel(DataModel):
|
|||
'duration': duration,
|
||||
'cpu_id': cpu_id,
|
||||
}
|
||||
self.times = self.times.append(data, ignore_index=True)
|
||||
self.times.loc[len(self.times.index)] = data
|
||||
|
||||
def print_model(self) -> None:
|
||||
"""Debug method to print every contained df."""
|
||||
|
|
|
@ -59,7 +59,7 @@ class ProfileDataModel(DataModel):
|
|||
'duration': duration,
|
||||
'actual_duration': actual_duration,
|
||||
}
|
||||
self.times = self.times.append(data, ignore_index=True)
|
||||
self.times.loc[len(self.times.index)] = data
|
||||
|
||||
def print_model(self) -> None:
|
||||
"""Debug method to print every contained df."""
|
||||
|
|
|
@ -143,7 +143,7 @@ class RosDataModel(DataModel):
|
|||
'duration': duration,
|
||||
'intra_process': intra_process,
|
||||
}
|
||||
self.callback_instances = self.callback_instances.append(data, ignore_index=True)
|
||||
self.callback_instances.loc[len(self.callback_instances.index)] = data
|
||||
|
||||
def print_model(self) -> None:
|
||||
"""Debug method to print every contained df."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue