Skip to content

Instantly share code, notes, and snippets.

View confidence_interval.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View GP.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View upload.py
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)
View dt.py
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),
View 1hour.sql
select
timestamp,
value
where
timestamp > ( to_unixtime(localtimestamp) - 3600)
order by timestamp asc
View work_with_subquery.sql
* | 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)
View not_work.sql
* | select
unixtime,
predict
from (
select
ts_predicate_ar(timestamp, value, 2, 10)
from log
)
View detect.sql
* | select
ts_cp_detect(timestamp, value, 50)
limit 1000
View generate_for_detection.py
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)),
View predicate.sql
* | select
ts_predicate_ar(timestamp, value, 2, 10)
limit 110
You can’t perform that action at this time.