SIENTIAPDE-1005

Add initial implementation of data processing activities and filters
This commit is contained in:
vitor-aignosi
2025-05-13 16:58:03 -03:00
parent 02bb052605
commit 4e579dd5bd
13 changed files with 345 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
from pandas import DataFrame
def check_data_range(value, val_range: list) -> bool:
if not value:
return True
bottom = val_range[0]
up = val_range[-1]
return value < bottom or value > up
def out_of_bounds_filter(df: DataFrame, nodes_data_range: dict):
return df[df.apply(lambda x: check_data_range(
x['value'], nodes_data_range[x['tag']]),
axis=1)]
def null_values_filter(df: DataFrame):
return df[df['value'].isnull()]