Spaces:
Configuration error
Configuration error
Download tests/unit/test_preprocessing.py from PCelia/Pret-a-depenser: direct link, hf CLI and curl.
- Browser
- Download file 446 Bytes
-
https://huggingface.co/spaces/PCelia/Pret-a-depenser/resolve/main/tests/unit/test_preprocessing.py
- Command line
-
hf download hf://spaces/PCelia/Pret-a-depenser/tests/unit/test_preprocessing.py
-
curl -L -o test_preprocessing.py https://huggingface.co/spaces/PCelia/Pret-a-depenser/resolve/main/tests/unit/test_preprocessing.py
446 Bytes
| import pandas as pd | |
| import numpy as np | |
| def dummy_preprocess(df: pd.DataFrame): | |
| return df.fillna(0) | |
| def test_preprocessing_no_crash_and_shape_preserved(): | |
| df = pd.DataFrame({ | |
| "A": [1, 2, np.nan], | |
| "B": [5, np.nan, 7] | |
| }) | |
| processed = dummy_preprocess(df) | |
| # même nombre de lignes | |
| assert processed.shape[0] == df.shape[0] | |
| # pas de NaN après traitement | |
| assert not processed.isna().any().any() |