上一页 1 ··· 182 183 184 185 186 187 188 189 190 ··· 408 下一页
摘要: 001、 >>> list1 = ["aa", "bb", "aa", "cc", "aa", "aa", "cc","ee"] ## 测试列表 >>> list1 ['aa', 'bb', 'aa', 'cc', 'aa', 'aa', 'cc', 'ee'] >&g 阅读全文
posted @ 2022-08-23 20:34 小鲨鱼2018 阅读(139) 评论(0) 推荐(0)
摘要: 001、 (base) root@PC1:/home/test3# ls a.txt (base) root@PC1:/home/test3# cat a.txt ## 测试数据 1 aa 2 bb 3 aa 4 cc 5 dd 6 cc 7 kk 8 aa 9 kk ## 根据第二列的重复项筛选数 阅读全文
posted @ 2022-08-23 20:16 小鲨鱼2018 阅读(278) 评论(0) 推荐(0)
摘要: 001、 library(dplyr) dat <- read.table("xx.map", header = F) ## 测试数据 dat dat %>% group_by(V1) %>% top_n(n = 2, wt = V2) ## 以第一列分类, 然后按照第二列从大到小排序,并提取前两个 阅读全文
posted @ 2022-08-23 19:59 小鲨鱼2018 阅读(772) 评论(0) 推荐(0)
摘要: 001、 test <- as.factor(c(2, 3, 7, 8)) test as.numeric(test) ## 不能直接将因子型转换为数值型 as.numeric(as.character(test)) ## 先转换为字符,然后转换为数值 阅读全文
posted @ 2022-08-22 23:09 小鲨鱼2018 阅读(378) 评论(0) 推荐(0)
摘要: 001、 dat3 <- matrix(1:16, nrow = 4, byrow = T) dat3 min(dat3) mean(dat3) max(dat3) dat3[] <- 0 ## 将矩阵元素全部设置为0(可以为任意元素) dat3 阅读全文
posted @ 2022-08-21 23:48 小鲨鱼2018 阅读(487) 评论(0) 推荐(0)
摘要: 001、删除第一列 (base) root@PC1:/home/test# cat test.txt 1 MIR1302-10 1 2 FAM138A 2 3 OR4F5 3 4 RP11-34P13.7 4 5 RP11-34P13.8 5 6 AL627309.1 6 7 RP11-34P13. 阅读全文
posted @ 2022-08-21 23:28 小鲨鱼2018 阅读(1721) 评论(0) 推荐(0)
摘要: 001、 >>> [[0] * 5 for i in range(3)] ## 生成3行5列,元素为0的矩阵 [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]] 002、 >>> [ [1, 2, 3] * 2 for i in range(6)] 阅读全文
posted @ 2022-08-20 01:38 小鲨鱼2018 阅读(339) 评论(0) 推荐(0)
摘要: pyhton 中内置函数enumerate用于将序列生成二元组。 001、 >>> str1 = "hello!" ## 测试字符串 >>> for i in enumerate(str1): ## enumerate用于将序列生成二元组 ... print(i) ... (0, 'h') (1, 阅读全文
posted @ 2022-08-20 01:18 小鲨鱼2018 阅读(54) 评论(0) 推荐(0)
摘要: 001、 >>> test1 = [] >>> test1 [] >>> if not test1: ## 判断列表为空 ... print("no element") ... no element 002、 >>> test1 = () >>> test1 () >>> if not test1: 阅读全文
posted @ 2022-08-20 01:05 小鲨鱼2018 阅读(536) 评论(0) 推荐(0)
摘要: 001、读取fasta文件 root@PC1:/home/test# ls a.fasta root@PC1:/home/test# cat a.fasta ## 测试数据 >Rosalind_1 ATCCAGCT >Rosalind_2 GGGCAACT >Rosalind_3 ATGGATCT 阅读全文
posted @ 2022-08-20 00:38 小鲨鱼2018 阅读(241) 评论(0) 推荐(0)
上一页 1 ··· 182 183 184 185 186 187 188 189 190 ··· 408 下一页