Hey! Just wanted to chime in—scaling variables to unit interval python is something I do all the time. MinMaxScaler is great, but if you’re looking for something lightweight, you can use numpy:
```python
import numpy as np
scaled_data = (data - np.min(data)) / (np.max(data) - np.min(data))
```
For edge cases, you can add a check like:
```python
if np.max(data) == np.min(data):
scaled_data = np.zeros_like(data)
```
Also, if speed is an issue, try numba for JIT compilation. It can speed up numpy operations significantly.
```python
import numpy as np
scaled_data = (data - np.min(data)) / (np.max(data) - np.min(data))
```
For edge cases, you can add a check like:
```python
if np.max(data) == np.min(data):
scaled_data = np.zeros_like(data)
```
Also, if speed is an issue, try numba for JIT compilation. It can speed up numpy operations significantly.
