-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalyze.py
More file actions
58 lines (45 loc) · 1.3 KB
/
Copy pathanalyze.py
File metadata and controls
58 lines (45 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import pandas as pd
import matplotlib.pyplot as plt
# 从CSV文件读取数据
df = pd.read_csv('data.csv', sep=',', skipinitialspace=True)
# 绘制图表
plt.plot(df['goods_num'], label='Goods Number')
plt.plot(df['pick_goods_num'], label='Pick Goods Number')
plt.plot(df['ship_goods_num'], label='Ship Goods Number')
# 添加图例
plt.legend()
plt.title('Goods Statistics')
plt.xlabel('Time')
plt.ylabel('Number')
plt.show()
# for goodsInfo.csv
# import pandas as pd
# import matplotlib.pyplot as plt
# # 读取CSV文件
# df = pd.read_csv('goodsInfo.csv')
# # 统计每个参数的商品数量
# goods_value_count = df['goodsValue'].value_counts()
# goods_region_count = df['goodsRegion'].value_counts()
# frame_count = df['Frame'].value_counts()
# # 绘制统计图
# plt.figure(figsize=(12, 8))
# # 商品价值统计图
# plt.subplot(3, 1, 1)
# goods_value_count.plot(kind='bar')
# plt.title('Goods Value Count')
# plt.xlabel('Goods Value')
# plt.ylabel('Count')
# # 商品区域统计图
# plt.subplot(3, 1, 2)
# goods_region_count.plot(kind='bar')
# plt.title('Goods Region Count')
# plt.xlabel('Goods Region')
# plt.ylabel('Count')
# # 帧数统计图
# plt.subplot(3, 1, 3)
# frame_count.plot(kind='bar')
# plt.title('Frame Count')
# plt.xlabel('Frame')
# plt.ylabel('Count')
# plt.tight_layout()
# plt.show()