Repair datasets with common bugs#

Repair datasets with common bugs

Export routines from battery test equipment can sometimes insert bugs like non-monotonic times. We have included some functions to recognize these occurences during validation along with some basic tools to repair them.

import bdf
from bdf.repair import fix_time
# Read the raw source data and display the header
df = bdf.read("https://zenodo.org/records/17295469/files/SINTEF__SLPBA842124HV__2024-10-23__Rate_25degC__Neware__Time_Bug.csv")
RuntimeWarning [bdf.validate:83]: Non-monotonic 'Test Time / s' detected: 19 drops (min Δ = -125193 s). Consider bdf.repair.fix_time(...).
bdf.plot(df)

image1

# Fix non-monotonic time
df = fix_time(df, method="auto")
# Visualize the repaired dataset
bdf.plot(df)

image2