摘要: pandas 基础 serise 0 4 1 7 2 5 3 3 dtype: int64 array([ 4, 7, 5, 3], dtype=int64) RangeIndex(start=0, stop=4, step=1) 1 7 3 3 dtype: int64 1 7 2 5 dtype 阅读全文
posted @ 2018-05-11 22:26 嘻呵呵 阅读(594) 评论(0) 推荐(0) 编辑
摘要: Counter函数可以对列表中数据进行统计每一个有多少种 most_common(10)可以提取前十位 [('w', 3)] Counter({'q': 2, 'w': 3}) pandas中的series对象有一个value_counts方法可以计数 .fillna()函数可以替换确实值NA {0 阅读全文
posted @ 2018-03-04 15:42 嘻呵呵 阅读(316) 评论(0) 推荐(0) 编辑
摘要: python基本元素 3 1 (2, 1) ( 1+0j) 3.3333333333333335 '3,1.00e2' '3,1.00e2' 'nanana' 'n' hhh ['frf'] 79 79 "thewrj ok poj 'po \njio lkn \n;jij \nj; %%javas 阅读全文
posted @ 2018-02-28 23:32 嘻呵呵 阅读(275) 评论(0) 推荐(0) 编辑
摘要: defaultdict函数将所有值初始化为指定类型 '' python按照引用传递 [1, 2, 3, 4] isinstance函数检查对象是否为某个特定的类型 False is用来判断两份引用是否指向同一个对象与 == 不同 True 字符串左边加上r表示字符应该按原本样子解释 e\\e str 阅读全文
posted @ 2018-02-27 22:29 嘻呵呵 阅读(368) 评论(0) 推荐(0) 编辑
摘要: 实践中,数据库中可能有数十亿条记录。查询结果有可能达到千万条。如果用dbGetQuery( ) 一次性取出所有查询结果,内存可能吃不消。但是,如果容许分块处理数据来完成任务,那么下述方法不失为一个好的选择。 library(DBI) library(RSQLite) con 阅读全文
posted @ 2018-01-23 14:00 嘻呵呵 阅读(1007) 评论(0) 推荐(0) 编辑
摘要: SQL函数 AVG select AVG(col) AS avgvalue from tablename select col2 from tablename where col1 (select AVG(col1) from tablename) COUNT 返回值不包含空值 select COU 阅读全文
posted @ 2018-01-22 21:53 嘻呵呵 阅读(365) 评论(0) 推荐(0) 编辑
摘要: SQL语法 LIMIT select col from table limit number select from table limit number LIKE select from table where col LIKE '%in%' select from table where col 阅读全文
posted @ 2018-01-22 16:47 嘻呵呵 阅读(3438) 评论(0) 推荐(0) 编辑
摘要: SQL语法 在表中选择列 select 列名 from 表名 选择所有列 select from 表名 返回唯一值 select distinct 列名 from 表名 where select from 表名 where city = 'beijng' select from 表名 where y 阅读全文
posted @ 2018-01-22 15:53 嘻呵呵 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 在R中获得快速运行代码的方法 使用向量化运算 R语言的并行计算可以用parallel和foreach包 加快R运行速度还可以使用cmpfun()函数即字节码编译器 再者就是在R中调用C或C++ 同时还可以利用Rprof()来寻找代码的瓶颈 利用分块或者R包来管理内存 阅读全文
posted @ 2018-01-19 21:35 嘻呵呵 阅读(2241) 评论(0) 推荐(0) 编辑
摘要: plyr 这个包,提供了一组规范的数据结构转换形式。 Input/Output| list | data frame | array | | | list | llply() | ldply() | laply() data frame | dlply() | ddply() | daply() a 阅读全文
posted @ 2018-01-18 21:41 嘻呵呵 阅读(3568) 评论(0) 推荐(0) 编辑