pandas
yangxiaodong88
让编程更简单,用好轮子,创造轮子。
展开
-
pandas 的学习和使用(一)
背景学习了 numpy 用pandas这个利器就非常棒了,前提是要学习好numpy 他是一个基础基础学习Seriesimport pandas as pdfrom pandas import Series, DataFramex = Series([1,2,3,4])print(x)print(x.values)print(x.index)x = Ser...原创 2018-02-09 18:04:50 · 527 阅读 · 0 评论 -
pandas 的学习和使用(二)
排序 排名from pandas import Series, DataFrameprint("series 排序")x = Series(range(4), index=['b', 'a', 'c', 'd'])print(x)# series 排序# b 0# a 1# c 2# d 3# dtype: int64print(x.sort_...原创 2018-02-24 14:58:37 · 237 阅读 · 0 评论 -
pandas yield csv 混合使用
背景运维需要压力测试,需要给他生成符合规则的数据。生成几万甚至百万的数据。这么大的数据就要考虑到速度和内存需求啦。pandas 写数据到csv 中data数据中是数组字典的data = { 'username': [i for i in cellphone_func()], 'cellphone_key': [i for i in cellphone_key_f...原创 2018-03-28 18:02:14 · 779 阅读 · 0 评论 -
pandas Series DataFrame 综合学习(2)
函数应用映射numpy 的ufuncs(元素级数组方法) 也可以用来操作pandas对象frame = DataFrame(np.arange(12.).reshape((4, 3)), columns=list('bde'), index=['one', 'two', 'three', 'four'] )pr...原创 2018-06-15 14:58:53 · 207 阅读 · 0 评论 -
pandas 之series
Series 的常用方法属性等获取Series 中的值1.obj = Series([2, 4, 7])print(obj)print(obj[0])print(obj[1])print(obj[2])输出# 0 2# 1 4# 2 7# dtype: int64# 2# 4# 72,有index 索引 获取值obj2 = Se...原创 2018-06-08 18:33:29 · 267 阅读 · 0 评论 -
pandas 将数据写入excel 并发形式
代码 def get_data(self, q): create_time = q.created_at beijing = MYDatetime.utc2beijing(create_time) str_time = MYDatetime.clock2string(beijing) data = dict() ...原创 2018-09-13 13:50:50 · 2584 阅读 · 0 评论