摘要: 来源:http://bbs.pinggu.org/thread-1219536-1-1.html ################ 生成数据 bh=1:100jxh=rep(1:17,c(4,5,6,7,8,4,5,6,7,8,4,5,5,5,6,7,8))relation=c(0,5,6,10,0 阅读全文
posted @ 2017-09-25 17:12 Emily_zhu 阅读(390) 评论(0) 推荐(0) 编辑
摘要: R语言中因子(factor)转换成数值型(numeric)的问题 对于数字型的分类型变量,需要保持其值不变且变量类型要强制转换成字符型时,用as.character, 不用as.factor。因为上面链接的问题。 阅读全文
posted @ 2017-07-27 20:13 Emily_zhu 阅读(5128) 评论(0) 推荐(0) 编辑
摘要: Numbering rows within groups in a data frame 阅读全文
posted @ 2017-07-12 17:24 Emily_zhu 阅读(1483) 评论(0) 推荐(0) 编辑
摘要: http://www.crifan.com/files/doc/docbook/python_beginner_tutorial/release/htmls/ch04_python_dev_env.html#how_dev_python_in_window 比较全面的介绍了Python开发环境 阅读全文
posted @ 2017-03-14 11:40 Emily_zhu 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 震惊小伙伴的单行代码 Python篇 在网上看到有python2.7的单行代码(链接如上): 自学python3.x中,于是简单的想将2.x版翻译成3.x版。其中第7条实现还未成功。待了解xml后再尝试。 1、让列表中的每个元素都乘以2 2、求列表中的所有元素之和 3、判断一个字符串中是否存在某些词 阅读全文
posted @ 2017-03-10 18:11 Emily_zhu 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 注:在stackoverflow.com发现的一个回答。非常简单并且成功安装,在这里保存一下。 Question:How to install xgboost package in python (windows platform)? The Part Of Answer I Used: I jus 阅读全文
posted @ 2017-03-09 15:28 Emily_zhu 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 汉诺塔 杨辉三角 注:普通函数和generator生成器的区别:1.普通函数调用直接返回结果,generator函数的调用,返回一个generator对象;(调用generator时可以先创建一个对象,再用next()方法不断获得下一个返回值,但实际中通常用for循环实现) 2.generator在 阅读全文
posted @ 2017-03-07 11:30 Emily_zhu 阅读(205) 评论(0) 推荐(0) 编辑
摘要: The general form of data.table syntax is: .SD , .SDcols , .N 等 .SD stands for something like "Subset of Data.table". There's no significance to the in 阅读全文
posted @ 2017-03-06 17:34 Emily_zhu 阅读(255) 评论(0) 推荐(0) 编辑
摘要: data: have <- data.frame(ID=paste0("id", c(101, 102, 102, 103, 103, 104, 105, 105)), info1=c("one", "twoA", "twoB", "threeA", "threeB", "four", "five" 阅读全文
posted @ 2017-03-06 12:16 Emily_zhu 阅读(1401) 评论(0) 推荐(0) 编辑