我正在尝试提醒用户,导航回来会将其注销。我在stackoverflow上找到了这个很好的代码,效果很好;但是,如果用户刷新页面,我不希望提醒用户。这是代码:
window.onbeforeunload = function(){
return "Going back will log you out, and lose your information. Are you sure you want to do this?";
};
我已经禁用退格按钮用于导航回来。此代码在用户使用导航后退箭头,鼠标按钮或页面刷新时提醒用户。除了页面刷新之外,我希望提醒所有内容。
答案 0 :(得分:0)
您可以使用unique = ["PRODUCT_1", ...] # unique products
accuracy
for i in unique:
first_subset = ??? # all rows for product `i` - how do I implement this correctly?
X = first_subset[:, 0]
Y = first_subset[:, 1]
prediction_product_1 = model.predict(X)
accuracy_product_1 = np.sum( (prediction_product_1)/np.sum(Y) )
accuracy.append([accuracy_product_1, PRODUCT_1])
:
onpopstate