Skip to content

Instantly share code, notes, and snippets.

e_set("timestamp",dt_totimestamp(dt_parse(v("dteday"))))
e_if(
e_search("weathersit==1"), e_set("good", 1, "normal", 0, "bad", 0, "terrible", 0),
e_search("weathersit==2"), e_set("good", 0, "normal", 1, "bad", 0, "terrible", 0),
e_search("weathersit==3"), e_set("good", 0, "normal", 0, "bad", 1, "terrible", 0),
e_search("weathersit==4"), e_set("good", 0, "normal", 0, "bad", 0, "terrible", 1)
)
e_if(
e_search("weekday==0"), e_set("sunday", 0, "monday", 0, "tuesday", 0, "wednesday", 0, "thursday", 0, "friday", 0, "saturday", 0),
e_search("weekday==1"), e_set("sunday", 0, "monday", 1, "tuesday", 0, "wednesday", 0, "thursday", 0, "friday", 0, "saturday", 0),
{
"dependencies": {
"@tensorflow-models/posenet": "^2.2.1",
"@tensorflow/tfjs": "^2.3.0",
"@tensorflow/tfjs-node": "^2.3.0",
"canvas": "^2.6.1",
"mathjs": "^7.2.0",
"typescript": "^4.0.2"
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
data = pd.read_csv("./day.csv")
for i in range(data.shape[0]):
contents = [list(zip(data.columns, map(lambda x: str(x), tuple(data.loc[i,:]))))]
put_logs(client, project, logstore, contents)
ar_data = np.concatenate((
generate(1.4, -0.48, 5, 0.5, 450),
generate(1.4, -0.48, 10, 0.5, 100),
generate(1.4, -0.48, 5, 0.5, 450)
))
timestamps = sorted(range(1000))
contents = []
for timestamp in timestamps:
contents.append([
("timestamp", str(timestamp)),
select
timestamp,
value
where
timestamp > ( to_unixtime(localtimestamp) - 3600)
order by timestamp asc
* | select
preds[1] as unixtime,
preds[3] as predict
from (
select
ts_predicate_ar(timestamp, value, 2, 10) as p
from log
), unnest(p) as t(preds)
* | select
unixtime,
predict
from (
select
ts_predicate_ar(timestamp, value, 2, 10)
from log
)
* | select
ts_cp_detect(timestamp, value, 50)
limit 1000