From f8f5e2ebb2f0bb37890258fe01b1c2821b07c82c Mon Sep 17 00:00:00 2001 From: rasmusthog Date: Sat, 15 Oct 2022 17:16:54 +0200 Subject: [PATCH] Reset index of cycles to start at 0 --- nafuma/electrochemistry/io.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nafuma/electrochemistry/io.py b/nafuma/electrochemistry/io.py index d46a1d5..9b57f38 100644 --- a/nafuma/electrochemistry/io.py +++ b/nafuma/electrochemistry/io.py @@ -357,6 +357,12 @@ def process_neware_data(df, options={}): max_capacity = dchg_df['ions'].max() dchg_df['ions'] = np.abs(dchg_df['ions'] - max_capacity) + + if not chg_df.empty: + chg_df.reset_index(inplace=True) + if not dchg_df.empty: + dchg_df.reset_index(inplace=True) + cycles.append((chg_df, dchg_df))