1234567891011121314151617181920 |
- import requests
- cmd_str = """
- def run(kwargs):
- import numpy as np
- from sklearn import preprocessing
- x = kwargs['x']
- min_max_scaler = preprocessing.MinMaxScaler()
- x_minmax = min_max_scaler.fit_transform(np.array(x).reshape(-1, 2))
- return x_minmax
- """
- s = [[1, 20, 30, 40, 5, 6, 7, 8, 9, 10], [1, 20, 30, 40, 5, 6, 7, 8, 9, 10]]
- kkk = {'x': s}
- print(requests.post("http://172.18.248.152:8000/exec", json={
- "function_str": cmd_str,
- "call_str": "run(kwargs)",
- "param_dict": {
- "kwargs": kkk
- }
- }).json())
|