上一页 1 2 3 4 5 6 7 ··· 19 下一页
摘要: 思路: - 取最近两个周期的数据分别做z-score标准化,然后对结果做差,最后在对结果求标准差。 - 比较标准差和1,小于1则是周期性数据。 原始数据 假设周期性是1天,有一条曲线,包含最近两天的时序数据。 import numpy as np import pandas as pd import 阅读全文
posted @ 2021-03-01 20:23 马贡多在下雨 阅读(3277) 评论(0) 推荐(0)
摘要: 前言 在上一节图的遍历算法的基础上,解决最短路径问题。 存在无权有向图如下: v1表示起点,v9表示终点,请找出有几条路可以达到,并且最短路径是哪个? 深度优先搜索算法求解 from collections import deque Start = "v1" Terminal = "v9" Q = 阅读全文
posted @ 2021-02-20 17:04 马贡多在下雨 阅读(95) 评论(0) 推荐(0)
摘要: 前言 图的遍历算法是求解图的连通性问题、拓扑排序和求关键路径等算法的基础。 通常有两种遍历图的方式:广度优先和深度优先(有无向图和有向图都适用),下面以有向图为例给出基于python的两种实现。 已知图如下所示: 广度优先搜索 from collections import deque VISITE 阅读全文
posted @ 2021-02-20 12:43 马贡多在下雨 阅读(507) 评论(0) 推荐(0)
摘要: Suppressing Stan optimizer printing in Python 1 # from https://stackoverflow.com/questions/11130156/suppress-stdout-stderr-print-from-python-functions 阅读全文
posted @ 2021-02-04 22:44 马贡多在下雨 阅读(475) 评论(0) 推荐(0)
摘要: 使用curl命令发送http POST请求 curl -v -X POST -d @data.json --header "Content-Type: application/json" $url curl -w选项 Defines what to display on stdout after a 阅读全文
posted @ 2021-01-19 20:29 马贡多在下雨 阅读(1238) 评论(0) 推荐(0)
摘要: 有文本文件,内容如下,需要找出response不为on的设备ip root@dev[15:49:33]$ cat result.txt index[8] ip[8.8.8.8] send response[ % Total % Received % Xferd Average Speed Time 阅读全文
posted @ 2020-12-28 15:56 马贡多在下雨 阅读(1780) 评论(0) 推荐(0)
摘要: 摘自这里 /sys/class/net/network-interface/statistics root@Dev[09:41:51]$ ll /sys/class/net/eth0/statistics total 0 -r--r--r-- 1 root root 4096 Jun 29 14:5 阅读全文
posted @ 2020-06-30 09:55 马贡多在下雨 阅读(352) 评论(0) 推荐(0)
摘要: golang多协程并发工作 package main import ( "fmt" "log" "os" "sync" "time" ) type Task struct { Name string Age int } func work(wg *sync.WaitGroup, jobs chan 阅读全文
posted @ 2020-06-09 17:11 马贡多在下雨 阅读(944) 评论(0) 推荐(1)
摘要: 模拟beego登陆 package main import ( "fmt" "time" "io/ioutil" "net/url" "net/http" "net/http/cookiejar" ) func main() { now := time.Now() var err error var 阅读全文
posted @ 2020-06-09 16:47 马贡多在下雨 阅读(222) 评论(0) 推荐(0)
摘要: 1. 文件去重 sort file |uniq sort -n file |uniq 2. 文件按某一列去重 # 按照第二列去重 root@solitude[20:28:32]$ cat file beijing::198 shanghai::87 shenzhen::87 beijing::100 阅读全文
posted @ 2020-02-10 20:35 马贡多在下雨 阅读(387) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 19 下一页