Skip to content

Commit c2b68aa

Browse files
committed
sort
1 parent 687af1b commit c2b68aa

File tree

6 files changed

+158
-192
lines changed

6 files changed

+158
-192
lines changed

.idea/matplotlib示例1.py

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 132 additions & 78 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python爬取斗鱼房间信息和数据分析/斗鱼直播房间数据分析.py

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,26 @@
22
import pandas
33
import matplotlib.pyplot as plt
44

5+
# 学习数据分析斗鱼房间信息
6+
7+
plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签
8+
plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号
9+
510
client = pymongo.MongoClient('localhost')
611
db = client["DouyuTV"]
712
room = db["Roominfo"]
8-
data = pandas.DataFrame(list(room.find()))
13+
# 使用pandas作图
14+
15+
# data = pandas.DataFrame(list(room.find()))
916
# del data['_id'], data['room_src'],data['vertical_src'],data['isVertical'] #去除不需要的数据
10-
data = data[['room_id', 'nickname', 'online', 'fans']] # 取得我们指定需要的数据
11-
l = list(data)
12-
print(l)
13-
print(type(l))
14-
name = data['nickname']
15-
online = data['online']
16-
# plt.plot(name,online,color='green',marker='o',linestyle='solid')
17-
# plt.title('小试牛刀')
18-
# plt.ylabel('people')
17+
# data = data[['room_id', 'nickname', 'online', 'fans']] # 取得我们指定需要的数据
18+
data = room.find()
19+
nickname = []
20+
online = []
21+
for i in data:
22+
nickname.append(i['nickname'])
23+
online.append(i['online'])
24+
plt.plot(online, online, color='green', marker='o', linestyle='solid')
25+
plt.title(u'douyuTV人气值')
26+
plt.ylabel('人气')
27+
plt.show()

newtest.py

Lines changed: 0 additions & 104 deletions
This file was deleted.

test3.py

Whitespace-only changes.
Binary file not shown.

0 commit comments

Comments
 (0)