csv_2_plot: fix assignment of 'elapsed_seconds' column to avoid SettingWithCopyWarning

Signed-off-by: YoungSoo Shin <shinys000114@gmail.com>
This commit is contained in:
2025-12-11 16:12:51 +09:00
parent b734915040
commit 9cb4734093

View File

@@ -40,7 +40,7 @@ def plot_power_data(csv_path, output_path, plot_types, sources,
x_axis_data = df['timestamp']
if relative_time:
start_time = df['timestamp'].iloc[0]
df['elapsed_seconds'] = (df['timestamp'] - start_time).dt.total_seconds()
df.loc[:, 'elapsed_seconds'] = (df['timestamp'] - start_time).dt.total_seconds()
x_axis_data = df['elapsed_seconds']
print("X-axis set to relative time (elapsed seconds).")
else: