Remove dependece on numpy

Note, this changes the standard deviation from population (old, numpy) to sample (new, pandas) and thus numerical values.
This commit is contained in:
Jose Gracia 2024-02-22 11:38:55 +01:00
parent bc6a5a3018
commit 7f0228a905

View file

@ -98,7 +98,7 @@ class Power:
def header(self):
hd = "# all timestamp have unit miliseconds since unix epoch\n"
hd += "# all power values have unit Watt\n"
hd += "timestamp,RESERVED,head_node_power,avg_node_power,median_node_power,min_node_power,max_node_power,std_dev_node_power"
hd += "timestamp,RESERVED,head_node_power,avg_node_power,median_node_power,min_node_power,max_node_power,std_dev_sample_node_power"
# add node names here instead
hd += "," + ",".join(self.nodes)
hd += "\n"
@ -115,11 +115,11 @@ class Power:
@staticmethod
def _summarize_values(df):
values = df['power'].values
head = values[0]
values = df['power']
head = values.iloc[0]
min, max = values.min(), values.max()
avg, stddev = values.mean(), values.std()
median = np.median(values)
median = values.median()
return Power.to_csv(head, avg, median, min, max, stddev)
def summarize_epoch(self, epoch):