function setcookie(cookieName, cookieValue, nDays) {
var today = new Date();
var expire = new Date();
if (nDays == null || nDays == 0) nDays = 1;
expire.setTime(today.getTime() + 3600000 * 24 * nDays); // changed that to * 14
document.cookie = cookieName + "=" + escape(cookieValue) + ";expires=" + expire.toGMTString();
}
function readcookie(cookieName) {
var theCookie = " " + document.cookie;
var ind = theCookie.indexOf(" " + cookieName + "=");
if (ind == -1) ind = theCookie.indexOf(";" + cookieName + …Run Code Online (Sandbox Code Playgroud)我在Google Cloud的计算引擎实例中设置了一个cron作业.
假设每天早上7:47运行.但是每次我检查文件是否在7:48执行时都不起作用.
helloworld.sh文件的代码在这里
echo "helloworld" + "$(date)" > helloworld.txt
Run Code Online (Sandbox Code Playgroud)
我已将root设置为root,并将root作为root用户设置为cron作业.有任何想法吗?
只有当列Dates等于时,我才试图计算得分 1 的平均值Oct-16:
我最初尝试的是:
import pandas as pd
import numpy as np
import os
dataFrame = pd.read_csv("test.csv")
for date in dataFrame["Dates"]:
if date == "Oct-16":
print(date)##Just checking
print(dataFrame["Score 1"].mean())
Run Code Online (Sandbox Code Playgroud)
但我的结果是整列的平均值 Score 1
我尝试的另一件事是手动告诉它要计算哪些指数的平均值:
dataFrame["Score 1"].iloc[0:2].mean()
Run Code Online (Sandbox Code Playgroud)
但理想情况下,如果Dates == "Oct-16".