上一页 1 ··· 130 131 132 133 134 135 136 137 138 ··· 403 下一页
摘要: 001、python报错 SyntaxError: Non-ASCII character '\xe8' in file test.py on line 6 原因:注释行中出现了中文 ,而python支持的ASCII码不支持中文。 002、解决方法 在头文件中增加: # -*- coding: ut 阅读全文
posted @ 2023-02-27 09:29 小鲨鱼2018 阅读(844) 评论(0) 推荐(0)
摘要: 001、 [b20223040323@admin1 test2]$ ls dat.txt test.py [b20223040323@admin1 test2]$ cat dat.txt ## 测试数据 gene1 gene2 gene3 0 1 0 0 1 1 1 0 0 0 1 1 [b2022 阅读全文
posted @ 2023-02-26 21:10 小鲨鱼2018 阅读(57) 评论(0) 推荐(0)
摘要: 001、 方法1 >>> list1 = [] >>> for i in range(5): ... list1.append("value") ... >>> list1 ['value', 'value', 'value', 'value', 'value'] 002、方法2 >>> list1 阅读全文
posted @ 2023-02-26 18:02 小鲨鱼2018 阅读(305) 评论(0) 推荐(0)
摘要: 001、 gene1 <- c(0,0,1,0) gene2 <- c(1,1,0,1) gene3 <- c(0,1,0,1) dat <- data.frame(gene1, gene2, gene3) ## 生成测试数据, 0表示基因缺失, 1表示基因存在 rate_0 <- function 阅读全文
posted @ 2023-02-26 17:14 小鲨鱼2018 阅读(66) 评论(0) 推荐(0)
摘要: 001、 统计单个元素 a <- c(3, 3 , 3, 2, 7, 2, 3) ## 测试向量 sum(a == 3) ## 统计3在向量中出现的次数 sum(a == 2) 002、 a <- c(3, 3 , 3, 2, 7, 2, 3) table(a) ## 统计所有元素的频次 003、适 阅读全文
posted @ 2023-02-26 16:59 小鲨鱼2018 阅读(346) 评论(0) 推荐(0)
摘要: 001、 系统 root@ubuntu01:/etc/netplan# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04 阅读全文
posted @ 2023-02-25 20:40 小鲨鱼2018 阅读(4239) 评论(0) 推荐(0)
摘要: 001、q,表示退出(匹配地址后退出sed脚本) [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 22 jj yy ss ff xx zz vv bb dd 00 ss 99 cc mm bb tt yy [root@PC1 阅读全文
posted @ 2023-02-25 17:14 小鲨鱼2018 阅读(325) 评论(0) 推荐(0)
摘要: 001、指定列的输入分隔符 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt aa:bb:cc 11:22:33 55:88:33 [root@PC1 test]# awk -F ":" '{print $2}' a.txt ## 使用-F 选 阅读全文
posted @ 2023-02-25 17:08 小鲨鱼2018 阅读(3207) 评论(0) 推荐(0)
摘要: 001、 ctrl + a: 将光标移动到命令行的开头,相当于键盘中的home键 002、 ctrl + e: 将光标移动到命令行的结尾,相当于键盘中的end键 003、ctrl + u: 剪切光标所在位置之前的内容 004、ctrl + k: 剪切光标所在位置之后的内容 005、ctrl + y: 阅读全文
posted @ 2023-02-25 09:48 小鲨鱼2018 阅读(80) 评论(0) 推荐(0)
摘要: 001、普通数组 普通数组的定义: ay=(100 200 300 "aa" "bb") ## 直接定义 [root@PC1 test]# ay2[0]=800 ## 单独定义每一个元素 [root@PC1 test]# ay2[1]="aaaa" [root@PC1 test]# ay2[2]=5 阅读全文
posted @ 2023-02-24 23:48 小鲨鱼2018 阅读(65) 评论(0) 推荐(0)
上一页 1 ··· 130 131 132 133 134 135 136 137 138 ··· 403 下一页