From 7b21727285e50b0b050c4ddd70d07542229c5366 Mon Sep 17 00:00:00 2001 From: pants Date: Mon, 21 Sep 2026 14:17:03 -0700 Subject: init --- python/other/lab6.py | 17 +++++++++++++++++ python/other/slop.py | 21 +++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 python/other/lab6.py create mode 100644 python/other/slop.py (limited to 'python/other') diff --git a/python/other/lab6.py b/python/other/lab6.py new file mode 100755 index 0000000..f41e9bc --- /dev/null +++ b/python/other/lab6.py @@ -0,0 +1,17 @@ +import numpy as np + +data = [384, 381, 384, 383, 385, 382, 384, 383, 384, 382] + +# print(np.average(data)) +# print(np.std(data)) + +data2 = [1.32, 1.40, 1.48, 1.35] + +print(np.average(data2)) +print(np.std(data2)) + +data3 = [0.27,0.30,0.30,0.31,0.29,0.27] + +# print(np.average(data3)) +# print(np.std(data3)) + diff --git a/python/other/slop.py b/python/other/slop.py new file mode 100644 index 0000000..5ba8ccf --- /dev/null +++ b/python/other/slop.py @@ -0,0 +1,21 @@ +import matplotlib.pyplot as plt +import numpy as np + +# Open and read the file +with open(".power_log", "r", encoding="utf-8") as f: + data = f.readlines() + +# Extract numerical values from each line +measurements = [float(line.strip()) for line in data] + +# Generate time values (assuming measurements are taken every second) +time_values = np.arange(len(measurements)) + +# Plot the data +plt.figure(figsize=(10, 6)) +plt.plot(time_values, measurements, marker='o', linestyle='-') +plt.title('Power Measurements Over Time') +plt.xlabel('Time (seconds)') +plt.ylabel('Power Measurement') +plt.grid(True) +plt.show() -- cgit v1.2.3