From a35cf796abc97fbf0922d815dc7da9b2ed7ff832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Boulogne?= Date: Tue, 29 Oct 2024 13:18:28 +0100 Subject: [PATCH] add every in loading --- labsw/__init__.py | 2 +- labsw/io.py | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/labsw/__init__.py b/labsw/__init__.py index 8ce9b36..7525d19 100644 --- a/labsw/__init__.py +++ b/labsw/__init__.py @@ -1 +1 @@ -__version__ = '0.1.3' +__version__ = '0.1.4' diff --git a/labsw/io.py b/labsw/io.py index b5611ed..7585d03 100644 --- a/labsw/io.py +++ b/labsw/io.py @@ -1,7 +1,7 @@ import pandas as pd import numpy as np -def load_data_RH_logger(filepath): +def load_data_RH_logger(filepath, every=1): """ """ @@ -14,13 +14,10 @@ def load_data_RH_logger(filepath): df = df.drop(columns='X') df = df.drop(np.arange(1)) - df['dm_m'] = (df['weight'] - df['weight'].iloc[0]) / df['weight'].iloc[0] + df['dm_m'] = (df['weight'] - df['weight'].iloc[0]) / df['weight'].iloc[0] # Crop data - #df = df.drop(df[df['time'] < 0.02 * 3600].index) df = df.reset_index() del df['index'] - #df.head() - #df = df[df['time'] > 301_000] - return df + return df.iloc[::every]