![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pandas
文章平均质量分 56
瓦力冫
喜欢看点书,跑跑步,热爱游戏编程
展开
-
python pandas 实战 百度音乐歌单 数据分析
是《Python 网络爬虫实战与机器学习应用》12章的例子,地址在 https://yuedu.baidu.com/ebook/8cd608073868011ca300a6c30c2259010302f34d1.播放次数分析 chart1 = df3.sort_values('playCount', ascending=False).drop_duplicates('name')plt.figu...原创 2018-06-13 10:10:37 · 1081 阅读 · 1 评论 -
python pandas 实战 对时区进行计数,用pyplot绘制前10
import pandasimport matplotlib.pyplot as pltimport numpy as npimport jsonfrom pandas import DataFrame, Seriespath = 'ch02/usagov_bitly_data2012-03-16-1331923249.txt'#从文件中读取records = [json.load...原创 2018-06-06 19:20:55 · 595 阅读 · 0 评论 -
python pandas 实战 显示时区按照windows和非windows进行分解
#去除naresults = Series([x.split()[0] for x in frame.a.dropna()])# print(results[:5])# print(results.value_counts()[:8])cframe = frame[frame.a.notnull()]#得到一个np,如果包含Windows就是Windows,不然是NotWindowso...原创 2018-06-06 19:23:01 · 397 阅读 · 0 评论 -
python pandas 实战 电影评分处理
import pandas as pdimport matplotlib.pyplot as pltimport numpy as npimport jsonfrom pandas import DataFrame, Seriesunames = ['user_id', 'gender', 'age', 'occupation', 'zip']#用read_table方式读取数据,...原创 2018-06-06 19:24:13 · 2231 阅读 · 0 评论 -
pandas 实战 连接mysql 统计公众号情况
1. 连接mysql,使用 read_sqlimport pymysqlimport pandas as pdimport matplotlib.pyplot as pltimport numpy as npconnect = pymysql.connect( host = '127.0.0.1', db = 'wxarticle',...原创 2018-07-31 16:19:45 · 732 阅读 · 0 评论 -
用candlestick_ohlc 画k线
import mpl_finance as mpffig, (ax1, ax2) = plt.subplots(2, sharex=True, figsize=(15,8))mpf.candlestick_ohlc(ax1,daysreshape.values,width=1.5,colorup='r',colordown='green')ax1.set_ylabel("price")#...原创 2018-08-26 09:00:43 · 10909 阅读 · 1 评论 -
pandas cut
import numpy as npfrom pandas import Series,DataFrameimport pandas as pd# 使用pandas的cut函数划分年龄组ages = [20,22,25,27,21,23,37,31,61,45,32]bins = [18,25,35,60,100]cats = pd.cut(ages,bins)print(cats...原创 2019-01-30 09:38:49 · 732 阅读 · 0 评论