import requests
response = requests.post('https://api.dztoolbox.com/metrics/ks', json={"y1_values": [1, 2, 3, 4], "y2_values": [6, 7, 8, 9]})
if response.ok:
print(f"{response.json()["metric"]} score is: {response.json()["score"]}")
fetch('https://api.dztoolbox.com/metrics/ks', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"y1_values": [1, 2, 3],
"y2_values": [5, 6, 7]
})
}).then(response => {
if (response.ok) {
return response.json();
} else {
throw new Error('Network response was not ok');
}
}).then(data => {
console.log(data["metric"] + " score is: " + data["score"]);
}).catch(error => {
console.error('Error updating settings', error);
});