a b/src/cleaning.py
1
# Caster les types des variables du df dans le type appropriƩ
2
def convertType(df, intToFloat, floatToInt):
3
    for col in intToFloat:
4
        df[col] = df[col].astype('float64')
5
    for col in floatToInt:
6
        df[col] = df[col].astype('int64')
7
    return df
8
9
# Fonction pour filtrer les valeurs aberrantes
10
def filter_outliers(df, col_limits):
11
    for col, limit in col_limits.items():
12
        df = df[df[col] < limit]
13
    return df
14
15