Download utils.py from PBJ/iSLR-demo: direct link, hf CLI and curl.
- Browser
- Download file 337 Bytes
-
https://huggingface.co/spaces/PBJ/iSLR-demo/resolve/main/utils.py
- Command line
-
hf download hf://spaces/PBJ/iSLR-demo/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/PBJ/iSLR-demo/resolve/main/utils.py
337 Bytes
| import numpy as np | |
| import pandas as pd | |
| def load_relevant_data_subset(df, ROWS_PER_FRAME): | |
| data_columns = ['x', 'y', 'z'] | |
| data = df | |
| n_frames = int(len(data) / ROWS_PER_FRAME) | |
| data = data.values.reshape(n_frames, ROWS_PER_FRAME, len(data_columns)) | |
| return data.astype(np.float32) | |
| def display_dataframe(): | |
| return df |