增加绘图以及图片属性转换(中英)

增加企业规模描述统计表
增加绘制供应链以及产业链度图
This commit is contained in:
Cricial 2025-05-25 22:15:12 +08:00
parent 8f4c5929bb
commit d57216d51f
35 changed files with 82855 additions and 153815 deletions

View File

@ -926,11 +926,11 @@ iiabmdb|schema||iiabm_user|localhost|UPDATE|G</Grants>
</collation>
<schema id="288" parent="1" name="iiabmdb">
<Current>1</Current>
<LastIntrospectionLocalTimestamp>2025-02-22.02:31:45</LastIntrospectionLocalTimestamp>
<LastIntrospectionLocalTimestamp>2025-02-22.13:47:26</LastIntrospectionLocalTimestamp>
<CollationName>utf8mb4_0900_ai_ci</CollationName>
</schema>
<schema id="289" parent="1" name="information_schema">
<LastIntrospectionLocalTimestamp>2025-02-22.02:31:45</LastIntrospectionLocalTimestamp>
<LastIntrospectionLocalTimestamp>2025-02-22.13:47:27</LastIntrospectionLocalTimestamp>
<CollationName>utf8mb3_general_ci</CollationName>
</schema>
<schema id="290" parent="1" name="performance_schema">

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DeveloperToolsToolWindowSettingsV1" lastSelectedContentNodeId="base64-encoder-decoder">
<developerToolsConfigurations />
</component>
</project>

Binary file not shown.

View File

@ -10,7 +10,6 @@ from mesa import Model
from typing import TYPE_CHECKING
from my_model import MyModel
from 查看进度 import visualize_progress
if TYPE_CHECKING:
from controller_db import ControllerDB

View File

@ -1 +1 @@
db_name_prefix: with_exp
db_name_prefix: without_exp

View File

@ -8,5 +8,5 @@ test: # only for test scenarios
n_iter: 100
not_test: # normal scenarios
n_sample: 10
n_iter: 50
n_sample: 50
n_iter: 100

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 KiB

View File

@ -10,7 +10,6 @@ from computation import Computation
from sqlalchemy.orm import close_all_sessions
import yaml
from controller_db import ControllerDB
from 查看进度 import visualize_progress
def controll_db_and_process(exp_argument, reset_sample_argument, reset_db_argument):
@ -36,10 +35,8 @@ def do_process(target: object, controller_db: ControllerDB, ):
i.join()
# 所有子进程完成后刷新最终进度
visualize_progress()
# 显示最终进度后关闭图表
plt.show()
def do_computation(c_db):
exp = Computation(c_db)
@ -54,10 +51,10 @@ def do_computation(c_db):
if __name__ == '__main__':
# 输入参数
parser = argparse.ArgumentParser(description='setting')
parser.add_argument('--exp', type=str, default='with_exp')
parser.add_argument('--exp', type=str, default='without_exp')
parser.add_argument('--job', type=int, default='4')
parser.add_argument('--reset_sample', type=int, default='0')
parser.add_argument('--reset_db', type=bool, default=False)
parser.add_argument('--reset_db', type=bool, default=True)
args = parser.parse_args()
# 几核参与进程

View File

@ -527,7 +527,6 @@ class MyModel(Model):
def resource_integration(self):
"""
整合企业资源包括材料设备和产品数据
功能:
- 加载并处理企业的材料设备和产品数据
- 合并设备数据与设备残值数据

View File

@ -0,0 +1,37 @@
idx_scenario,n_max_trial,prf_size,prf_conn,cap_limit_prob_type,cap_limit_level,diff_new_conn,remove_t,netw_prf_n,mean_count_firm_prod,mean_count_firm,mean_count_prod,mean_max_ts_firm_prod,mean_max_ts_firm,mean_max_ts_prod,mean_n_remove_firm_prod,mean_n_all_prod_remove_firm,mean_end_ts,
0,7,1,1,uniform,5.0000,0.3000,3,3,59.6916,15.7589,13.3347,1.5063,1.5032,1.3842,12.3074,1.5379,2.0400
1,5,1,1,uniform,10.0000,0.5000,5,2,61.8937,17.1126,13.8095,1.7284,1.7263,1.6042,22.7779,2.9611,3.7432
2,3,1,1,uniform,15.0000,0.7000,7,1,63.9568,18.2253,14.2779,1.8263,1.8221,1.7347,30.9263,3.7842,5.6253
3,7,1,1,uniform,5.0000,0.3000,3,2,59.5811,15.7474,13.3168,1.4958,1.4937,1.3884,12.8358,1.4621,2.0221
4,5,1,1,uniform,10.0000,0.5000,5,1,61.8200,17.0116,13.8053,1.7095,1.7084,1.6032,22.5474,2.9579,3.6811
5,3,1,1,uniform,15.0000,0.7000,7,3,63.8821,18.2547,14.2432,1.8421,1.8305,1.7295,30.9474,3.7411,5.6632
6,7,1,1,normal,5.0000,0.5000,7,3,59.9116,15.7516,13.3316,1.4905,1.4884,1.3674,12.2463,1.3326,3.1600
7,5,1,1,normal,10.0000,0.7000,3,2,61.3095,16.8326,13.7716,1.7011,1.7011,1.6011,22.4779,2.9642,2.4916
8,3,1,1,normal,15.0000,0.3000,5,1,63.6568,18.1316,14.2358,1.8253,1.8232,1.7242,31.1253,3.7400,4.3474
9,7,1,0,uniform,5.0000,0.7000,5,3,59.7158,15.6811,13.3000,1.4600,1.4568,1.3537,12.4063,1.3400,2.5316
10,5,1,0,uniform,10.0000,0.3000,7,2,63.0063,17.6695,14.0432,1.8063,1.8053,1.6747,22.6916,3.0042,5.1126
11,3,1,0,uniform,15.0000,0.5000,3,1,63.6779,18.3842,14.3547,1.8621,1.8600,1.7621,31.3663,4.0253,2.9632
12,7,1,0,normal,10.0000,0.7000,3,1,60.6295,16.3884,13.5811,1.6179,1.6147,1.5147,22.5221,2.7800,2.3495
13,5,1,0,normal,15.0000,0.3000,5,3,63.3484,18.0042,14.2074,1.8316,1.8263,1.7232,30.6379,3.7747,4.2979
14,3,1,0,normal,5.0000,0.5000,7,2,64.0737,18.3684,14.3000,1.8505,1.8484,1.7589,11.4789,1.1663,4.1400
15,7,1,0,normal,10.0000,0.7000,5,3,61.0337,16.5684,13.6053,1.6358,1.6347,1.5074,22.7474,2.8937,3.5147
16,5,1,0,normal,15.0000,0.3000,7,2,63.4747,18.0568,14.1989,1.8347,1.8305,1.7263,30.4063,3.7989,5.7295
17,3,1,0,normal,5.0000,0.5000,3,1,63.7158,18.2863,14.2958,1.8547,1.8537,1.7579,14.6568,2.1432,2.8368
18,7,0,1,normal,10.0000,0.3000,7,1,61.2326,16.6442,13.6789,1.6705,1.6684,1.5495,22.5453,2.8379,4.7474
19,5,0,1,normal,15.0000,0.5000,3,3,62.3863,17.4684,13.9905,1.7874,1.7853,1.6705,31.1558,3.8189,2.7926
20,3,0,1,normal,5.0000,0.7000,5,2,62.8305,17.6074,14.0811,1.7705,1.7695,1.6768,11.7621,1.2474,3.2684
21,7,0,1,normal,10.0000,0.5000,7,1,61.1832,16.5389,13.6874,1.6505,1.6484,1.5337,22.8484,2.8147,4.7326
22,5,0,1,normal,15.0000,0.7000,3,3,62.3305,17.5337,14.0011,1.7768,1.7747,1.6495,30.6705,3.7832,2.7316
23,3,0,1,normal,5.0000,0.3000,5,2,62.8821,17.6916,14.0905,1.7821,1.7821,1.6895,12.2158,1.3442,3.3484
24,7,0,1,uniform,15.0000,0.5000,3,2,62.2463,17.4084,13.9789,1.7979,1.7958,1.6674,30.6842,3.7126,2.7589
25,5,0,1,uniform,5.0000,0.7000,5,1,60.9453,16.4442,13.6316,1.6274,1.6263,1.5032,12.2347,1.2663,2.7368
26,3,0,1,uniform,10.0000,0.3000,7,3,63.3400,17.8968,14.1147,1.8084,1.8074,1.6937,22.7768,3.0442,5.2442
27,7,0,0,normal,15.0000,0.5000,5,2,62.6505,17.5074,14.0032,1.7811,1.7800,1.6758,30.0211,3.6116,4.1263
28,5,0,0,normal,5.0000,0.7000,7,1,60.9200,16.5126,13.6168,1.6368,1.6358,1.5168,11.9432,1.2495,3.3305
29,3,0,0,normal,10.0000,0.3000,3,3,63.9074,18.4432,14.3916,1.8811,1.8779,1.7789,25.4905,3.4789,3.0295
30,7,0,0,uniform,15.0000,0.7000,7,2,62.2442,17.2747,13.9400,1.7400,1.7358,1.6253,30.5084,3.6589,5.4421
31,5,0,0,uniform,5.0000,0.3000,3,1,61.9147,17.2211,13.9347,1.7558,1.7526,1.6453,12.8168,1.6895,2.4516
32,3,0,0,uniform,10.0000,0.5000,5,3,64.1074,18.3579,14.3558,1.8579,1.8568,1.7505,22.2800,3.0684,4.0642
33,7,0,0,uniform,15.0000,0.3000,5,1,62.8737,17.5600,14.0642,1.7895,1.7874,1.6684,30.5453,3.6695,4.2147
34,5,0,0,uniform,5.0000,0.5000,7,3,61.6337,16.9042,13.7632,1.7032,1.7011,1.5716,12.0011,1.2263,3.5221
35,3,0,0,uniform,10.0000,0.7000,3,2,62.9663,17.9737,14.2221,1.8221,1.8211,1.7211,22.6979,3.1600,2.7389
1 idx_scenario,n_max_trial,prf_size,prf_conn,cap_limit_prob_type,cap_limit_level,diff_new_conn,remove_t,netw_prf_n,mean_count_firm_prod,mean_count_firm,mean_count_prod,mean_max_ts_firm_prod,mean_max_ts_firm,mean_max_ts_prod,mean_n_remove_firm_prod,mean_n_all_prod_remove_firm,mean_end_ts,
2 0,7,1,1,uniform,5.0000,0.3000,3,3,59.6916,15.7589,13.3347,1.5063,1.5032,1.3842,12.3074,1.5379,2.0400
3 1,5,1,1,uniform,10.0000,0.5000,5,2,61.8937,17.1126,13.8095,1.7284,1.7263,1.6042,22.7779,2.9611,3.7432
4 2,3,1,1,uniform,15.0000,0.7000,7,1,63.9568,18.2253,14.2779,1.8263,1.8221,1.7347,30.9263,3.7842,5.6253
5 3,7,1,1,uniform,5.0000,0.3000,3,2,59.5811,15.7474,13.3168,1.4958,1.4937,1.3884,12.8358,1.4621,2.0221
6 4,5,1,1,uniform,10.0000,0.5000,5,1,61.8200,17.0116,13.8053,1.7095,1.7084,1.6032,22.5474,2.9579,3.6811
7 5,3,1,1,uniform,15.0000,0.7000,7,3,63.8821,18.2547,14.2432,1.8421,1.8305,1.7295,30.9474,3.7411,5.6632
8 6,7,1,1,normal,5.0000,0.5000,7,3,59.9116,15.7516,13.3316,1.4905,1.4884,1.3674,12.2463,1.3326,3.1600
9 7,5,1,1,normal,10.0000,0.7000,3,2,61.3095,16.8326,13.7716,1.7011,1.7011,1.6011,22.4779,2.9642,2.4916
10 8,3,1,1,normal,15.0000,0.3000,5,1,63.6568,18.1316,14.2358,1.8253,1.8232,1.7242,31.1253,3.7400,4.3474
11 9,7,1,0,uniform,5.0000,0.7000,5,3,59.7158,15.6811,13.3000,1.4600,1.4568,1.3537,12.4063,1.3400,2.5316
12 10,5,1,0,uniform,10.0000,0.3000,7,2,63.0063,17.6695,14.0432,1.8063,1.8053,1.6747,22.6916,3.0042,5.1126
13 11,3,1,0,uniform,15.0000,0.5000,3,1,63.6779,18.3842,14.3547,1.8621,1.8600,1.7621,31.3663,4.0253,2.9632
14 12,7,1,0,normal,10.0000,0.7000,3,1,60.6295,16.3884,13.5811,1.6179,1.6147,1.5147,22.5221,2.7800,2.3495
15 13,5,1,0,normal,15.0000,0.3000,5,3,63.3484,18.0042,14.2074,1.8316,1.8263,1.7232,30.6379,3.7747,4.2979
16 14,3,1,0,normal,5.0000,0.5000,7,2,64.0737,18.3684,14.3000,1.8505,1.8484,1.7589,11.4789,1.1663,4.1400
17 15,7,1,0,normal,10.0000,0.7000,5,3,61.0337,16.5684,13.6053,1.6358,1.6347,1.5074,22.7474,2.8937,3.5147
18 16,5,1,0,normal,15.0000,0.3000,7,2,63.4747,18.0568,14.1989,1.8347,1.8305,1.7263,30.4063,3.7989,5.7295
19 17,3,1,0,normal,5.0000,0.5000,3,1,63.7158,18.2863,14.2958,1.8547,1.8537,1.7579,14.6568,2.1432,2.8368
20 18,7,0,1,normal,10.0000,0.3000,7,1,61.2326,16.6442,13.6789,1.6705,1.6684,1.5495,22.5453,2.8379,4.7474
21 19,5,0,1,normal,15.0000,0.5000,3,3,62.3863,17.4684,13.9905,1.7874,1.7853,1.6705,31.1558,3.8189,2.7926
22 20,3,0,1,normal,5.0000,0.7000,5,2,62.8305,17.6074,14.0811,1.7705,1.7695,1.6768,11.7621,1.2474,3.2684
23 21,7,0,1,normal,10.0000,0.5000,7,1,61.1832,16.5389,13.6874,1.6505,1.6484,1.5337,22.8484,2.8147,4.7326
24 22,5,0,1,normal,15.0000,0.7000,3,3,62.3305,17.5337,14.0011,1.7768,1.7747,1.6495,30.6705,3.7832,2.7316
25 23,3,0,1,normal,5.0000,0.3000,5,2,62.8821,17.6916,14.0905,1.7821,1.7821,1.6895,12.2158,1.3442,3.3484
26 24,7,0,1,uniform,15.0000,0.5000,3,2,62.2463,17.4084,13.9789,1.7979,1.7958,1.6674,30.6842,3.7126,2.7589
27 25,5,0,1,uniform,5.0000,0.7000,5,1,60.9453,16.4442,13.6316,1.6274,1.6263,1.5032,12.2347,1.2663,2.7368
28 26,3,0,1,uniform,10.0000,0.3000,7,3,63.3400,17.8968,14.1147,1.8084,1.8074,1.6937,22.7768,3.0442,5.2442
29 27,7,0,0,normal,15.0000,0.5000,5,2,62.6505,17.5074,14.0032,1.7811,1.7800,1.6758,30.0211,3.6116,4.1263
30 28,5,0,0,normal,5.0000,0.7000,7,1,60.9200,16.5126,13.6168,1.6368,1.6358,1.5168,11.9432,1.2495,3.3305
31 29,3,0,0,normal,10.0000,0.3000,3,3,63.9074,18.4432,14.3916,1.8811,1.8779,1.7789,25.4905,3.4789,3.0295
32 30,7,0,0,uniform,15.0000,0.7000,7,2,62.2442,17.2747,13.9400,1.7400,1.7358,1.6253,30.5084,3.6589,5.4421
33 31,5,0,0,uniform,5.0000,0.3000,3,1,61.9147,17.2211,13.9347,1.7558,1.7526,1.6453,12.8168,1.6895,2.4516
34 32,3,0,0,uniform,10.0000,0.5000,5,3,64.1074,18.3579,14.3558,1.8579,1.8568,1.7505,22.2800,3.0684,4.0642
35 33,7,0,0,uniform,15.0000,0.3000,5,1,62.8737,17.5600,14.0642,1.7895,1.7874,1.6684,30.5453,3.6695,4.2147
36 34,5,0,0,uniform,5.0000,0.5000,7,3,61.6337,16.9042,13.7632,1.7032,1.7011,1.5716,12.0011,1.2263,3.5221
37 35,3,0,0,uniform,10.0000,0.7000,3,2,62.9663,17.9737,14.2221,1.8221,1.8211,1.7211,22.6979,3.1600,2.7389

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 MiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

View File

@ -1,164 +1,175 @@
id_firm,count
70634828,5066
3147511625,5066
653528340,5052
3103797386,5046
888395016,5046
301209792,5046
2327031723,5042
2317245827,5036
631449822,5032
2348941764,5026
194210021,5022
191912252,5012
3048263744,5002
3215814536,4996
2354145351,4992
2312490120,1910
503176785,1850
25685135,1566
2944892892,1556
2624175,1546
3269039233,1546
3445928818,1476
2321109759,1466
3299144127,1456
930767828,726
3407754893,716
571058167,350
343012684,350
750610681,350
2317841563,350
888356483,350
2320475044,350
43407343,350
152008168,350
413274977,350
3111033905,350
3069206426,350
25945288,350
607512171,340
448033045,340
653528340,4007
2348941764,3957
3215814536,3831
888395016,3750
2354145351,3619
3147511625,3346
3048263744,3326
2317245827,3230
631449822,3149
3103797386,3123
194210021,3077
2327031723,3004
301209792,2997
191912252,2804
70634828,2464
2321109759,1165
3299144127,1130
3445928818,1120
2312490120,1077
503176785,1003
930767828,467
3407754893,451
2944892892,355
3269039233,354
750610681,353
25685135,351
343012684,342
3069206426,339
448033045,329
2624175,328
2320475044,321
413274977,314
3111033905,310
2317841563,310
43407343,304
571058167,302
607512171,286
152008168,272
888356483,250
25945288,222
1452048,20
2311838590,20
2424229017,20
3373311444,20
11807506,20
400488703,10
420984285,10
400692942,10
2424229017,18
4208851809,10
3445244192,10
888478182,10
3271705843,10
3269940677,10
420984285,10
400488703,10
400692942,10
354897041,10
9,10
4518234098,10
3433628561,10
3398677646,10
3395900897,10
3384021594,10
3372913783,10
3344297292,10
3462551351,10
3288105727,10
3312358902,10
9746245,10
887840774,10
5007015990,10
3344297292,10
3372913783,10
3384021594,10
3445244192,10
3433628561,10
3395900897,10
453289520,10
593312758,10
1033972427,10
581407487,10
474279224,10
857978527,10
7299120,10
7,10
737770776,10
762985858,10
771821595,10
80158773,10
829768,10
863079,10
495782506,10
868012326,10
872394725,10
887840774,10
888478182,10
9,10
9746245,10
71271700,10
7,10
695995052,10
688155470,10
654825436,10
771821595,10
80158773,10
644292599,10
829768,10
620220747,10
615763365,10
594378026,10
857978527,10
474279224,10
593312758,10
591452402,10
5849940,10
3271705843,10
581407487,10
3226664625,10
561545339,10
560866402,10
549184982,10
863079,10
5278074,10
868012326,10
71271700,10
495782506,10
483081978,10
1033972427,10
3127420424,10
3269940677,10
218633337,10
2343704209,10
2341555098,10
2339684065,10
2339188563,10
2337952436,10
2333843479,10
2329375731,10
2327979389,10
2326478786,10
2324844174,10
2324787028,10
2320102626,10
2316990095,10
2310825263,10
213386023,10
2352036411,10
203314437,10
2010673,10
1679596339,10
1606833003,10
159511306,10
15613202,10
1549474227,10
151606446,10
145511905,10
1375606900,10
1307012237,10
1217957486,10
118882692,10
1128343125,10
2349656760,10
24284343,10
3267688490,10
24673506,10
3226664625,10
3221190269,10
3211956484,10
3203777710,10
3195502499,10
3188903709,10
3177507356,10
3133307899,10
3122923980,10
3120341363,10
3113895788,10
3072715478,10
3070859372,10
3047163873,10
3045721313,10
3026382513,10
3025036704,10
29954548,10
2820140348,10
278221281,10
27731896,10
2728939,10
271860868,10
27075840,10
26516263,10
26162741,10
2545430247,10
251189644,10
25036634,10
996174506,10
11164476478,6
3221190269,10
2311581270,10
2316990095,10
2320102626,10
2324787028,10
2324844174,10
2326478786,10
2327979389,10
2329375731,10
2333843479,10
2337952436,10
2339684065,10
2341555098,10
2343704209,10
2347013470,10
2350418059,10
2352036411,10
2313209417,10
2310825263,10
3211956484,10
218633337,10
1128343125,10
118882692,10
1217957486,10
1307012237,10
1375606900,10
145511905,10
151606446,10
1549474227,10
15613202,10
159511306,10
1606833003,10
1679596339,10
2010673,10
203314437,10
213386023,10
24284343,10
24673506,10
25036634,10
3120341363,10
3047163873,10
3070859372,10
3072715478,10
3089095447,10
3100891962,10
3113895788,10
3122923980,10
251189644,10
11164476478,10
3133307899,10
3177507356,10
3188352290,10
3188903709,10
3195502499,10
3045721313,10
3031009366,10
3026382513,10
271860868,10
2545430247,10
26162741,10
26516263,10
3025036704,10
27075840,10
2728939,10
27731896,10
278221281,10
2820140348,10
29954548,10
3398677646,9
3127420424,9
5007015990,8
3203777710,8
2339188563,7
483081978,6
517717050,6

1 id_firm count
2 70634828 653528340 5066 4007
3 3147511625 2348941764 5066 3957
4 653528340 3215814536 5052 3831
5 3103797386 888395016 5046 3750
6 888395016 2354145351 5046 3619
7 301209792 3147511625 5046 3346
8 2327031723 3048263744 5042 3326
9 2317245827 5036 3230
10 631449822 5032 3149
11 2348941764 3103797386 5026 3123
12 194210021 5022 3077
13 191912252 2327031723 5012 3004
14 3048263744 301209792 5002 2997
15 3215814536 191912252 4996 2804
16 2354145351 70634828 4992 2464
17 2312490120 2321109759 1910 1165
18 503176785 3299144127 1850 1130
19 25685135 3445928818 1566 1120
20 2944892892 2312490120 1556 1077
21 2624175 503176785 1546 1003
22 3269039233 930767828 1546 467
23 3445928818 3407754893 1476 451
24 2321109759 2944892892 1466 355
25 3299144127 3269039233 1456 354
26 930767828 750610681 726 353
27 3407754893 25685135 716 351
28 571058167 343012684 350 342
29 343012684 3069206426 350 339
30 750610681 448033045 350 329
31 2317841563 2624175 350 328
32 888356483 2320475044 350 321
33 2320475044 413274977 350 314
34 43407343 3111033905 350 310
35 152008168 2317841563 350 310
36 413274977 43407343 350 304
37 3111033905 571058167 350 302
38 3069206426 607512171 350 286
39 25945288 152008168 350 272
40 607512171 888356483 340 250
41 448033045 25945288 340 222
42 1452048 20
43 2311838590 20
2424229017 20
44 3373311444 20
45 11807506 20
46 400488703 2424229017 10 18
420984285 10
400692942 10
47 4208851809 10
48 3445244192 3271705843 10
49 888478182 3269940677 10
50 420984285 10
51 400488703 10
52 400692942 10
53 354897041 10
54 9 3462551351 10
55 4518234098 3288105727 10
3433628561 10
3398677646 10
3395900897 10
3384021594 10
3372913783 10
3344297292 10
56 3312358902 10
57 9746245 3344297292 10
58 887840774 3372913783 10
59 5007015990 3384021594 10
60 3445244192 10
61 3433628561 10
62 3395900897 10
63 453289520 10
64 593312758 1033972427 10
65 581407487 10
66 474279224 10
67 857978527 10
68 7299120 10
69 7 737770776 10
70 762985858 10
71 771821595 10
72 80158773 10
73 829768 10
74 863079 10
75 495782506 10
76 868012326 10
77 872394725 10
78 887840774 10
79 888478182 10
80 9 10
81 9746245 10
82 71271700 10
83 7 10
84 695995052 10
85 688155470 10
86 654825436 10
771821595 10
80158773 10
87 644292599 10
829768 10
88 620220747 10
89 615763365 10
90 594378026 10
91 857978527 593312758 10
474279224 10
92 591452402 10
93 5849940 10
94 3271705843 3226664625 10
581407487 10
95 561545339 10
96 560866402 10
97 549184982 10
863079 10
98 5278074 10
868012326 10
71271700 10
495782506 10
483081978 10
1033972427 10
3127420424 10
3269940677 10
218633337 10
2343704209 10
2341555098 10
2339684065 10
2339188563 10
2337952436 10
2333843479 10
2329375731 10
2327979389 10
2326478786 10
2324844174 10
2324787028 10
2320102626 10
2316990095 10
2310825263 10
213386023 10
2352036411 10
203314437 10
2010673 10
1679596339 10
1606833003 10
159511306 10
15613202 10
1549474227 10
151606446 10
145511905 10
1375606900 10
1307012237 10
1217957486 10
118882692 10
1128343125 10
2349656760 10
24284343 10
99 3267688490 10
24673506 10
3226664625 10
3221190269 10
3211956484 10
3203777710 10
3195502499 10
3188903709 10
3177507356 10
3133307899 10
3122923980 10
3120341363 10
3113895788 10
3072715478 10
3070859372 10
3047163873 10
3045721313 10
3026382513 10
3025036704 10
29954548 10
2820140348 10
278221281 10
27731896 10
2728939 10
271860868 10
27075840 10
26516263 10
26162741 10
2545430247 10
251189644 10
25036634 10
100 996174506 10
101 11164476478 3221190269 6 10
102 2311581270 10
103 2316990095 10
104 2320102626 10
105 2324787028 10
106 2324844174 10
107 2326478786 10
108 2327979389 10
109 2329375731 10
110 2333843479 10
111 2337952436 10
112 2339684065 10
113 2341555098 10
114 2343704209 10
115 2347013470 10
116 2350418059 10
117 2352036411 10
118 2313209417 10
119 2310825263 10
120 3211956484 10
121 218633337 10
122 1128343125 10
123 118882692 10
124 1217957486 10
125 1307012237 10
126 1375606900 10
127 145511905 10
128 151606446 10
129 1549474227 10
130 15613202 10
131 159511306 10
132 1606833003 10
133 1679596339 10
134 2010673 10
135 203314437 10
136 213386023 10
137 24284343 10
138 24673506 10
139 25036634 10
140 3120341363 10
141 3047163873 10
142 3070859372 10
143 3072715478 10
144 3089095447 10
145 3100891962 10
146 3113895788 10
147 3122923980 10
148 251189644 10
149 11164476478 10
150 3133307899 10
151 3177507356 10
152 3188352290 10
153 3188903709 10
154 3195502499 10
155 3045721313 10
156 3031009366 10
157 3026382513 10
158 271860868 10
159 2545430247 10
160 26162741 10
161 26516263 10
162 3025036704 10
163 27075840 10
164 2728939 10
165 27731896 10
166 278221281 10
167 2820140348 10
168 29954548 10
169 3398677646 9
170 3127420424 9
171 5007015990 8
172 3203777710 8
173 2339188563 7
174 483081978 6
175 517717050 6

View File

@ -1,359 +1,370 @@
id_firm,id_product,count
25685135,99,1566
2944892892,99,1556
3269039233,99,1546
2624175,99,1546
3445928818,95,1476
2321109759,95,1466
3299144127,95,1456
930767828,90,726
3407754893,90,716
194210021,50,646
3147511625,50,646
2327031723,50,646
191912252,50,646
631449822,50,646
653528340,50,636
2348941764,50,636
2317245827,50,636
3215814536,50,636
888395016,50,636
70634828,50,636
301209792,50,636
2354145351,50,636
3048263744,50,636
3103797386,50,636
2317245827,54,596
301209792,54,596
2317245827,51,596
3048263744,54,596
3103797386,51,596
194210021,54,596
194210021,53,596
2348941764,51,596
191912252,54,596
191912252,53,596
3215814536,53,596
3215814536,54,596
2348941764,54,596
2354145351,53,596
888395016,53,596
70634828,53,596
70634828,54,596
2327031723,54,596
3147511625,54,596
2327031723,53,596
653528340,54,596
653528340,53,596
631449822,54,596
2327031723,51,586
2354145351,54,586
301209792,51,586
2317245827,53,586
301209792,53,586
653528340,51,586
3215814536,51,586
3048263744,53,586
888395016,51,586
3103797386,54,586
3147511625,51,586
3103797386,53,586
3048263744,51,586
888395016,54,586
194210021,51,586
2354145351,51,576
191912252,51,576
631449822,51,576
2348941764,53,576
3147511625,53,576
631449822,53,576
70634828,51,576
653528340,52,556
70634828,52,556
3147511625,52,556
888395016,52,556
631449822,52,556
3103797386,52,546
301209792,52,546
2327031723,52,546
3147511625,55,536
2354145351,52,536
888395016,55,536
2348941764,52,536
631449822,55,536
653528340,55,536
2317245827,52,536
3048263744,52,536
70634828,55,536
191912252,52,536
194210021,52,536
3103797386,55,526
301209792,55,526
2327031723,55,526
3215814536,52,526
2354145351,55,516
2348941764,55,516
194210021,55,516
3048263744,55,516
2317245827,55,516
191912252,55,516
3215814536,55,506
2312490120,39,380
503176785,43,366
2312490120,43,366
3069206426,93,350
3111033905,93,350
571058167,94,350
25945288,93,350
43407343,93,350
343012684,92,350
413274977,91,350
888356483,91,350
503176785,40,350
2320475044,94,350
152008168,94,350
2317841563,91,350
750610681,92,350
448033045,94,340
607512171,91,340
2312490120,40,336
2312490120,38,336
503176785,38,326
503176785,39,316
2348941764,49,260
2348941764,48,260
3103797386,45,260
2317245827,44,260
2317245827,45,260
2317245827,46,260
301209792,49,260
301209792,48,260
3103797386,44,260
3103797386,48,260
3103797386,46,260
888395016,46,260
3215814536,49,260
3215814536,48,260
3215814536,47,260
3215814536,46,260
888395016,49,260
888395016,48,260
888395016,47,260
3147511625,49,260
3103797386,47,260
3147511625,48,260
3147511625,47,260
3147511625,46,260
3147511625,45,260
3147511625,44,260
3103797386,49,260
301209792,46,260
301209792,47,260
70634828,44,260
301209792,45,260
2348941764,44,260
301209792,44,260
2317245827,49,260
70634828,49,260
70634828,48,260
70634828,46,260
70634828,47,260
70634828,45,260
2317245827,47,260
2348941764,45,260
2348941764,46,260
2348941764,47,260
2317245827,48,260
631449822,45,256
191912252,49,256
191912252,48,256
191912252,47,256
191912252,46,256
631449822,48,256
191912252,45,256
631449822,47,256
631449822,46,256
2327031723,49,256
631449822,44,256
2327031723,48,256
2354145351,44,256
2327031723,47,256
191912252,44,256
2354145351,49,256
2354145351,48,256
2354145351,47,256
2354145351,46,256
2354145351,45,256
194210021,44,256
3048263744,45,256
2327031723,46,256
3048263744,49,256
653528340,44,256
653528340,45,256
653528340,46,256
2312490120,41,256
653528340,47,256
653528340,48,256
3048263744,44,256
3048263744,46,256
3048263744,47,256
3048263744,48,256
653528340,49,256
503176785,41,256
194210021,49,256
194210021,48,256
2327031723,45,256
194210021,47,256
2327031723,44,256
194210021,46,256
194210021,45,256
631449822,49,256
888395016,44,250
888395016,45,250
3215814536,45,250
3215814536,44,250
503176785,42,236
2312490120,42,236
549184982,69,10
474279224,71,10
4518234098,12,10
2321109759,95,1155
3299144127,95,1138
3445928818,95,1123
930767828,90,468
3407754893,90,443
653528340,55,434
653528340,52,430
2348941764,55,427
2348941764,52,425
2354145351,52,421
3215814536,52,421
888395016,55,420
2354145351,55,419
888395016,52,411
3215814536,55,409
653528340,54,397
653528340,53,396
653528340,50,395
653528340,51,395
750610681,92,389
343012684,92,379
2348941764,51,379
3048263744,55,379
2354145351,53,377
3147511625,52,374
2354145351,51,372
888395016,50,371
888395016,53,371
3048263744,52,370
888395016,51,369
2348941764,53,369
2348941764,54,367
3147511625,55,367
2354145351,54,365
448033045,94,364
2354145351,50,364
2348941764,50,361
3269039233,99,361
888395016,54,358
3215814536,51,355
2944892892,99,354
2317245827,55,353
25685135,99,351
2317245827,52,350
3215814536,54,349
631449822,55,349
3069206426,93,348
3215814536,50,347
194210021,52,346
631449822,52,345
3215814536,53,344
3111033905,93,343
2327031723,52,341
191912252,55,341
70634828,52,340
3103797386,55,339
194210021,55,336
301209792,52,335
301209792,55,333
3103797386,52,332
191912252,52,330
2320475044,94,327
3147511625,53,322
3048263744,53,319
2327031723,55,318
2624175,99,318
3147511625,51,316
3048263744,51,312
3147511625,54,310
2317245827,50,308
3147511625,50,307
3048263744,50,307
571058167,94,306
2317245827,53,303
2317841563,91,303
3048263744,54,302
2317245827,54,298
631449822,51,297
194210021,53,297
413274977,91,295
3103797386,50,291
2317245827,51,291
3103797386,51,290
43407343,93,289
70634828,55,289
607512171,91,288
194210021,51,288
3103797386,53,287
194210021,50,287
194210021,54,286
631449822,53,285
653528340,48,285
152008168,94,283
653528340,49,283
653528340,46,282
631449822,50,281
3103797386,54,281
653528340,45,278
2327031723,53,277
653528340,44,276
653528340,47,276
2327031723,50,275
631449822,54,273
191912252,54,272
2327031723,51,270
301209792,54,266
2312490120,41,266
888395016,45,266
2348941764,49,266
191912252,51,264
301209792,53,263
2348941764,48,262
2348941764,46,262
2348941764,45,261
301209792,51,261
301209792,50,260
2327031723,54,259
888395016,49,259
2348941764,47,257
191912252,50,256
888395016,48,256
2348941764,44,253
888395016,46,253
2354145351,46,252
70634828,51,252
888395016,47,251
2312490120,42,250
191912252,53,248
888395016,44,248
2354145351,47,247
2354145351,49,246
2354145351,48,245
3215814536,49,241
70634828,54,239
3215814536,48,238
888356483,91,236
3215814536,46,236
70634828,50,232
3215814536,47,232
2354145351,45,231
2354145351,44,231
3215814536,44,230
3215814536,45,230
3048263744,48,230
70634828,53,229
3048263744,47,227
3048263744,46,221
3048263744,45,220
3048263744,44,217
194210021,46,217
2317245827,44,217
3048263744,49,216
3147511625,48,212
3147511625,49,212
3147511625,45,210
3147511625,44,210
2317245827,46,209
503176785,42,208
503176785,41,208
3147511625,47,206
194210021,48,206
3103797386,44,205
2317245827,47,204
194210021,44,203
2317245827,49,203
3147511625,46,202
2317245827,45,201
194210021,45,200
3103797386,49,200
631449822,45,199
194210021,49,197
191912252,49,196
3103797386,46,196
2317245827,48,196
2327031723,49,195
194210021,47,194
25945288,93,194
631449822,49,193
2327031723,48,192
301209792,46,192
70634828,49,191
191912252,46,190
191912252,44,190
2327031723,45,190
3103797386,47,190
631449822,48,189
3103797386,48,189
301209792,44,188
631449822,47,185
301209792,45,185
191912252,48,183
191912252,45,183
631449822,44,183
2327031723,46,182
503176785,43,182
3103797386,45,181
70634828,46,180
631449822,46,180
2327031723,44,180
301209792,48,177
2327031723,47,176
191912252,47,174
301209792,49,174
301209792,47,173
70634828,48,173
70634828,47,172
70634828,44,165
70634828,45,160
2312490120,40,140
2312490120,39,139
2312490120,38,135
503176785,39,128
503176785,38,122
2312490120,43,119
503176785,40,110
3133307899,23,20
3395900897,73,18
3221190269,20,17
3384021594,64,15
2820140348,62,15
1375606900,67,15
3445244192,24,15
887840774,8,15
3312358902,59,14
26516263,8,14
24284343,35,14
251189644,23,14
7,10,14
26162741,11,14
400692942,68,13
354897041,72,13
996174506,15,13
3211956484,34,13
203314437,22,13
11807506,23,13
1307012237,68,13
194210021,7,13
2010673,64,13
3373311444,20,13
688155470,30,13
2347013470,61,13
271860868,12,13
71271700,27,12
863079,11,12
420984285,16,12
644292599,11,12
9,37,12
5849940,26,12
9746245,97,12
868012326,29,12
1033972427,61,12
3373311444,71,12
3120341363,79,12
1128343125,63,12
1217957486,31,12
1452048,63,12
191912252,7,12
2311838590,97,12
2327979389,13,12
2341555098,11,12
2354145351,7,12
2728939,63,12
25036634,31,12
3271705843,62,12
3344297292,12,12
2350418059,79,11
15613202,32,11
2352036411,17,11
653528340,7,11
3269940677,28,11
278221281,66,11
2324844174,67,11
2317245827,7,11
3045721313,25,11
3070859372,62,11
771821595,10,11
615763365,68,11
1679596339,74,11
561545339,33,11
2311581270,19,11
888478182,9,11
3398677646,79,11
888395016,7,11
3195502499,18,11
1549474227,67,11
474279224,71,11
453289520,37,10
581407487,72,10
483081978,36,10
5007015990,74,10
495782506,19,10
5278074,36,10
561545339,33,10
560866402,9,10
1033972427,61,10
5849940,26,10
7299120,32,10
9746245,97,10
9,37,10
888478182,9,10
888395016,7,10
887840774,8,10
868012326,29,10
863079,11,10
857978527,60,10
829768,23,10
80158773,69,10
771821595,10,10
762985858,72,10
71271700,27,10
591452402,66,10
70634828,7,10
7,10,10
695995052,8,10
420984285,16,10
654825436,61,10
653528340,7,10
644292599,11,10
631449822,7,10
620220747,15,10
615763365,68,10
594378026,27,10
593312758,31,10
688155470,30,10
3070859372,62,10
4208851809,16,10
2337952436,24,10
2316990095,66,10
2317245827,7,10
2320102626,18,10
2324787028,18,10
2324844174,67,10
2326478786,60,10
2327031723,7,10
2327979389,13,10
2329375731,31,10
2333843479,70,10
2339188563,37,10
25036634,31,10
2339684065,74,10
2341555098,11,10
2343704209,69,10
2348941764,7,10
2349656760,79,10
2352036411,17,10
2354145351,7,10
2424229017,26,10
2424229017,30,10
24284343,35,10
2311838590,97,10
2311838590,34,10
2310825263,15,10
218633337,33,10
1128343125,63,10
11807506,23,10
2313209417,32,10
11807506,60,10
118882692,35,10
1217957486,31,10
1307012237,68,10
1375606900,67,10
1452048,30,10
1452048,63,10
145511905,68,10
151606446,61,10
1549474227,67,10
15613202,32,10
159511306,69,10
1606833003,9,10
1679596339,74,10
191912252,7,10
194210021,7,10
2010673,64,10
203314437,22,10
213386023,19,10
24673506,67,10
251189644,23,10
400692942,68,10
3312358902,59,10
2324787028,18,10
5278074,36,10
2327031723,7,10
3188903709,65,10
3195502499,18,10
3203777710,74,10
3211956484,34,10
3215814536,7,10
3221190269,20,10
3226664625,28,10
3267688490,73,10
3269940677,28,10
3271705843,62,10
3344297292,12,10
2545430247,25,10
3372913783,20,10
3373311444,20,10
3373311444,71,10
3384021594,64,10
3395900897,73,10
3398677646,79,10
3433628561,29,10
3445244192,24,10
354897041,72,10
695995052,8,10
2343704209,69,10
400488703,28,10
3177507356,24,10
3147511625,7,10
3133307899,23,10
3127420424,32,10
26162741,11,10
26516263,8,10
27075840,65,10
271860868,12,10
2728939,63,10
27731896,20,10
278221281,66,10
2820140348,62,10
29954548,27,10
301209792,7,10
3025036704,17,10
3026382513,15,10
3045721313,25,10
118882692,35,10
3047163873,27,10
3048263744,7,10
3072715478,33,10
3103797386,7,10
3113895788,35,10
3120341363,79,10
3127420424,32,10
151606446,61,10
3122923980,34,10
996174506,15,10
11164476478,60,6
593312758,31,10
80158773,69,10
145511905,68,10
4208851809,16,10
2311838590,34,9
2348941764,7,9
2326478786,60,9
872394725,70,9
737770776,34,9
218633337,33,9
2333843479,70,9
213386023,19,9
2337952436,24,9
1606833003,9,9
159511306,69,9
3072715478,33,9
3267688490,73,9
3026382513,15,9
3203777710,74,9
5007015990,74,9
3188352290,64,9
3177507356,24,9
620220747,15,9
3031009366,59,9
631449822,7,9
581407487,72,8
591452402,66,8
594378026,27,8
3100891962,26,8
3215814536,7,8
24673506,67,8
2339188563,37,8
29954548,27,8
2339684065,74,8
3462551351,13,8
560866402,9,7
3103797386,7,7
2320102626,18,7
3288105727,36,7
829768,23,7
2424229017,30,7
11164476478,60,7
762985858,72,7
7299120,32,7
70634828,7,7
2316990095,66,7
3025036704,17,7
3113895788,35,7
654825436,61,6
1452048,30,6
3147511625,7,6
3226664625,28,6
549184982,69,6
301209792,7,6
2545430247,25,6
2329375731,31,6
27075840,65,6
857978527,60,6
2424229017,26,6
3048263744,7,6
3433628561,29,5
517717050,36,5
495782506,19,5
483081978,36,5
27731896,20,5
3089095447,22,5
2310825263,15,4

1 id_firm id_product count
2 25685135 2321109759 99 95 1566 1155
3 2944892892 3299144127 99 95 1556 1138
4 3269039233 3445928818 99 95 1546 1123
5 2624175 930767828 99 90 1546 468
6 3445928818 3407754893 95 90 1476 443
7 2321109759 653528340 95 55 1466 434
8 3299144127 653528340 95 52 1456 430
9 930767828 2348941764 90 55 726 427
10 3407754893 2348941764 90 52 716 425
11 194210021 2354145351 50 52 646 421
12 3147511625 3215814536 50 52 646 421
13 2327031723 888395016 50 55 646 420
14 191912252 2354145351 50 55 646 419
15 631449822 888395016 50 52 646 411
16 653528340 3215814536 50 55 636 409
17 2348941764 653528340 50 54 636 397
18 2317245827 653528340 50 53 636 396
19 3215814536 653528340 50 636 395
20 888395016 653528340 50 51 636 395
21 70634828 750610681 50 92 636 389
22 301209792 343012684 50 92 636 379
23 2354145351 2348941764 50 51 636 379
24 3048263744 50 55 636 379
25 3103797386 2354145351 50 53 636 377
26 2317245827 3147511625 54 52 596 374
27 301209792 2354145351 54 51 596 372
28 2317245827 888395016 51 50 596 371
29 3048263744 888395016 54 53 596 371
30 3103797386 3048263744 51 52 596 370
31 194210021 888395016 54 51 596 369
32 194210021 2348941764 53 596 369
33 2348941764 51 54 596 367
34 191912252 3147511625 54 55 596 367
35 191912252 2354145351 53 54 596 365
36 3215814536 448033045 53 94 596 364
37 3215814536 2354145351 54 50 596 364
38 2348941764 54 50 596 361
39 2354145351 3269039233 53 99 596 361
40 888395016 53 54 596 358
41 70634828 3215814536 53 51 596 355
42 70634828 2944892892 54 99 596 354
43 2327031723 2317245827 54 55 596 353
44 3147511625 25685135 54 99 596 351
45 2327031723 2317245827 53 52 596 350
46 653528340 3215814536 54 596 349
47 653528340 631449822 53 55 596 349
48 631449822 3069206426 54 93 596 348
49 2327031723 3215814536 51 50 586 347
50 2354145351 194210021 54 52 586 346
51 301209792 631449822 51 52 586 345
52 2317245827 3215814536 53 586 344
53 301209792 3111033905 53 93 586 343
54 653528340 2327031723 51 52 586 341
55 3215814536 191912252 51 55 586 341
56 3048263744 70634828 53 52 586 340
57 888395016 3103797386 51 55 586 339
58 3103797386 194210021 54 55 586 336
59 3147511625 301209792 51 52 586 335
60 3103797386 301209792 53 55 586 333
61 3048263744 3103797386 51 52 586 332
62 888395016 191912252 54 52 586 330
63 194210021 2320475044 51 94 586 327
64 2354145351 3147511625 51 53 576 322
65 191912252 3048263744 51 53 576 319
66 631449822 2327031723 51 55 576 318
67 2348941764 2624175 53 99 576 318
68 3147511625 53 51 576 316
69 631449822 3048263744 53 51 576 312
70 70634828 3147511625 51 54 576 310
71 653528340 2317245827 52 50 556 308
72 70634828 3147511625 52 50 556 307
73 3147511625 3048263744 52 50 556 307
74 888395016 571058167 52 94 556 306
75 631449822 2317245827 52 53 556 303
76 3103797386 2317841563 52 91 546 303
77 301209792 3048263744 52 54 546 302
78 2327031723 2317245827 52 54 546 298
79 3147511625 631449822 55 51 536 297
80 2354145351 194210021 52 53 536 297
81 888395016 413274977 55 91 536 295
82 2348941764 3103797386 52 50 536 291
83 631449822 2317245827 55 51 536 291
84 653528340 3103797386 55 51 536 290
85 2317245827 43407343 52 93 536 289
86 3048263744 70634828 52 55 536 289
87 70634828 607512171 55 91 536 288
88 191912252 194210021 52 51 536 288
89 194210021 3103797386 52 53 536 287
90 3103797386 194210021 55 50 526 287
91 301209792 194210021 55 54 526 286
92 2327031723 631449822 55 53 526 285
93 3215814536 653528340 52 48 526 285
94 2354145351 152008168 55 94 516 283
95 2348941764 653528340 55 49 516 283
96 194210021 653528340 55 46 516 282
97 3048263744 631449822 55 50 516 281
98 2317245827 3103797386 55 54 516 281
99 191912252 653528340 55 45 516 278
100 3215814536 2327031723 55 53 506 277
101 2312490120 653528340 39 44 380 276
102 503176785 653528340 43 47 366 276
103 2312490120 2327031723 43 50 366 275
104 3069206426 631449822 93 54 350 273
105 3111033905 191912252 93 54 350 272
106 571058167 2327031723 94 51 350 270
107 25945288 301209792 93 54 350 266
108 43407343 2312490120 93 41 350 266
109 343012684 888395016 92 45 350 266
110 413274977 2348941764 91 49 350 266
111 888356483 191912252 91 51 350 264
112 503176785 301209792 40 53 350 263
113 2320475044 2348941764 94 48 350 262
114 152008168 2348941764 94 46 350 262
115 2317841563 2348941764 91 45 350 261
116 750610681 301209792 92 51 350 261
117 448033045 301209792 94 50 340 260
118 607512171 2327031723 91 54 340 259
119 2312490120 888395016 40 49 336 259
120 2312490120 2348941764 38 47 336 257
121 503176785 191912252 38 50 326 256
122 503176785 888395016 39 48 316 256
123 2348941764 49 44 260 253
124 2348941764 888395016 48 46 260 253
125 3103797386 2354145351 45 46 260 252
126 2317245827 70634828 44 51 260 252
127 2317245827 888395016 45 47 260 251
128 2317245827 2312490120 46 42 260 250
129 301209792 191912252 49 53 260 248
130 301209792 888395016 48 44 260 248
131 3103797386 2354145351 44 47 260 247
132 3103797386 2354145351 48 49 260 246
133 3103797386 2354145351 46 48 260 245
134 888395016 3215814536 46 49 260 241
135 3215814536 70634828 49 54 260 239
136 3215814536 48 260 238
137 3215814536 888356483 47 91 260 236
138 3215814536 46 260 236
139 888395016 70634828 49 50 260 232
140 888395016 3215814536 48 47 260 232
141 888395016 2354145351 47 45 260 231
142 3147511625 2354145351 49 44 260 231
143 3103797386 3215814536 47 44 260 230
144 3147511625 3215814536 48 45 260 230
145 3147511625 3048263744 47 48 260 230
146 3147511625 70634828 46 53 260 229
147 3147511625 3048263744 45 47 260 227
148 3147511625 3048263744 44 46 260 221
149 3103797386 3048263744 49 45 260 220
150 301209792 3048263744 46 44 260 217
151 301209792 194210021 47 46 260 217
152 70634828 2317245827 44 260 217
153 301209792 3048263744 45 49 260 216
154 2348941764 3147511625 44 48 260 212
155 301209792 3147511625 44 49 260 212
156 2317245827 3147511625 49 45 260 210
157 70634828 3147511625 49 44 260 210
158 70634828 2317245827 48 46 260 209
159 70634828 503176785 46 42 260 208
160 70634828 503176785 47 41 260 208
161 70634828 3147511625 45 47 260 206
162 2317245827 194210021 47 48 260 206
163 2348941764 3103797386 45 44 260 205
164 2348941764 2317245827 46 47 260 204
165 2348941764 194210021 47 44 260 203
166 2317245827 48 49 260 203
167 631449822 3147511625 45 46 256 202
168 191912252 2317245827 49 45 256 201
169 191912252 194210021 48 45 256 200
170 191912252 3103797386 47 49 256 200
171 191912252 631449822 46 45 256 199
172 631449822 194210021 48 49 256 197
173 191912252 45 49 256 196
174 631449822 3103797386 47 46 256 196
175 631449822 2317245827 46 48 256 196
176 2327031723 49 256 195
177 631449822 194210021 44 47 256 194
178 2327031723 25945288 48 93 256 194
179 2354145351 631449822 44 49 256 193
180 2327031723 47 48 256 192
181 191912252 301209792 44 46 256 192
182 2354145351 70634828 49 256 191
183 2354145351 191912252 48 46 256 190
184 2354145351 191912252 47 44 256 190
185 2354145351 2327031723 46 45 256 190
186 2354145351 3103797386 45 47 256 190
187 194210021 631449822 44 48 256 189
188 3048263744 3103797386 45 48 256 189
189 2327031723 301209792 46 44 256 188
190 3048263744 631449822 49 47 256 185
191 653528340 301209792 44 45 256 185
192 653528340 191912252 45 48 256 183
193 653528340 191912252 46 45 256 183
194 2312490120 631449822 41 44 256 183
195 653528340 2327031723 47 46 256 182
196 653528340 503176785 48 43 256 182
197 3048263744 3103797386 44 45 256 181
198 3048263744 70634828 46 256 180
199 3048263744 631449822 47 46 256 180
200 3048263744 2327031723 48 44 256 180
201 653528340 301209792 49 48 256 177
202 503176785 2327031723 41 47 256 176
203 194210021 191912252 49 47 256 174
204 194210021 301209792 48 49 256 174
205 2327031723 301209792 45 47 256 173
206 194210021 70634828 47 48 256 173
207 2327031723 70634828 44 47 256 172
208 194210021 70634828 46 44 256 165
209 194210021 70634828 45 256 160
210 631449822 2312490120 49 40 256 140
211 888395016 2312490120 44 39 250 139
212 888395016 2312490120 45 38 250 135
213 3215814536 503176785 45 39 250 128
214 3215814536 503176785 44 38 250 122
215 503176785 2312490120 42 43 236 119
216 2312490120 503176785 42 40 236 110
217 549184982 3133307899 69 23 10 20
218 474279224 3395900897 71 73 10 18
219 4518234098 3221190269 12 20 10 17
220 3384021594 64 15
221 2820140348 62 15
222 1375606900 67 15
223 3445244192 24 15
224 887840774 8 15
225 3312358902 59 14
226 26516263 8 14
227 24284343 35 14
228 251189644 23 14
229 7 10 14
230 26162741 11 14
231 400692942 68 13
232 354897041 72 13
233 996174506 15 13
234 3211956484 34 13
235 203314437 22 13
236 11807506 23 13
237 1307012237 68 13
238 194210021 7 13
239 2010673 64 13
240 3373311444 20 13
241 688155470 30 13
242 2347013470 61 13
243 271860868 12 13
244 71271700 27 12
245 863079 11 12
246 420984285 16 12
247 644292599 11 12
248 9 37 12
249 5849940 26 12
250 9746245 97 12
251 868012326 29 12
252 1033972427 61 12
253 3373311444 71 12
254 3120341363 79 12
255 1128343125 63 12
256 1217957486 31 12
257 1452048 63 12
258 191912252 7 12
259 2311838590 97 12
260 2327979389 13 12
261 2341555098 11 12
262 2354145351 7 12
263 2728939 63 12
264 25036634 31 12
265 3271705843 62 12
266 3344297292 12 12
267 2350418059 79 11
268 15613202 32 11
269 2352036411 17 11
270 653528340 7 11
271 3269940677 28 11
272 278221281 66 11
273 2324844174 67 11
274 2317245827 7 11
275 3045721313 25 11
276 3070859372 62 11
277 771821595 10 11
278 615763365 68 11
279 1679596339 74 11
280 561545339 33 11
281 2311581270 19 11
282 888478182 9 11
283 3398677646 79 11
284 888395016 7 11
285 3195502499 18 11
286 1549474227 67 11
287 474279224 71 11
288 453289520 37 10
289 581407487 2313209417 72 32 10
483081978 36 10
5007015990 74 10
495782506 19 10
5278074 36 10
561545339 33 10
560866402 9 10
1033972427 61 10
5849940 26 10
7299120 32 10
9746245 97 10
9 37 10
888478182 9 10
888395016 7 10
887840774 8 10
868012326 29 10
863079 11 10
857978527 60 10
829768 23 10
80158773 69 10
771821595 10 10
762985858 72 10
71271700 27 10
591452402 66 10
70634828 7 10
7 10 10
695995052 8 10
420984285 16 10
654825436 61 10
653528340 7 10
644292599 11 10
631449822 7 10
620220747 15 10
615763365 68 10
594378026 27 10
593312758 31 10
688155470 30 10
3070859372 62 10
4208851809 16 10
2337952436 24 10
2316990095 66 10
2317245827 7 10
2320102626 18 10
2324787028 18 10
2324844174 67 10
2326478786 60 10
2327031723 7 10
2327979389 13 10
2329375731 31 10
2333843479 70 10
2339188563 37 10
25036634 31 10
2339684065 74 10
2341555098 11 10
2343704209 69 10
2348941764 7 10
2349656760 79 10
2352036411 17 10
2354145351 7 10
2424229017 26 10
2424229017 30 10
24284343 35 10
2311838590 97 10
2311838590 34 10
2310825263 15 10
218633337 33 10
1128343125 63 10
11807506 23 10
290 11807506 60 10
291 118882692 2324787028 35 18 10
292 1217957486 5278074 31 36 10
293 1307012237 2327031723 68 7 10
1375606900 67 10
1452048 30 10
1452048 63 10
145511905 68 10
151606446 61 10
1549474227 67 10
15613202 32 10
159511306 69 10
1606833003 9 10
1679596339 74 10
191912252 7 10
194210021 7 10
2010673 64 10
203314437 22 10
213386023 19 10
24673506 67 10
251189644 23 10
400692942 68 10
3312358902 59 10
294 3188903709 65 10
3195502499 18 10
3203777710 74 10
3211956484 34 10
3215814536 7 10
3221190269 20 10
3226664625 28 10
3267688490 73 10
3269940677 28 10
3271705843 62 10
3344297292 12 10
2545430247 25 10
295 3372913783 20 10
296 3373311444 695995052 20 8 10
297 3373311444 2343704209 71 69 10
3384021594 64 10
3395900897 73 10
3398677646 79 10
3433628561 29 10
3445244192 24 10
354897041 72 10
298 400488703 28 10
299 3177507356 118882692 24 35 10
3147511625 7 10
3133307899 23 10
3127420424 32 10
26162741 11 10
26516263 8 10
27075840 65 10
271860868 12 10
2728939 63 10
27731896 20 10
278221281 66 10
2820140348 62 10
29954548 27 10
301209792 7 10
3025036704 17 10
3026382513 15 10
3045721313 25 10
300 3047163873 27 10
301 3048263744 3127420424 7 32 10
302 3072715478 151606446 33 61 10
3103797386 7 10
3113895788 35 10
3120341363 79 10
303 3122923980 34 10
304 996174506 593312758 15 31 10
305 11164476478 80158773 60 69 6 10
306 145511905 68 10
307 4208851809 16 10
308 2311838590 34 9
309 2348941764 7 9
310 2326478786 60 9
311 872394725 70 9
312 737770776 34 9
313 218633337 33 9
314 2333843479 70 9
315 213386023 19 9
316 2337952436 24 9
317 1606833003 9 9
318 159511306 69 9
319 3072715478 33 9
320 3267688490 73 9
321 3026382513 15 9
322 3203777710 74 9
323 5007015990 74 9
324 3188352290 64 9
325 3177507356 24 9
326 620220747 15 9
327 3031009366 59 9
328 631449822 7 9
329 581407487 72 8
330 591452402 66 8
331 594378026 27 8
332 3100891962 26 8
333 3215814536 7 8
334 24673506 67 8
335 2339188563 37 8
336 29954548 27 8
337 2339684065 74 8
338 3462551351 13 8
339 560866402 9 7
340 3103797386 7 7
341 2320102626 18 7
342 3288105727 36 7
343 829768 23 7
344 2424229017 30 7
345 11164476478 60 7
346 762985858 72 7
347 7299120 32 7
348 70634828 7 7
349 2316990095 66 7
350 3025036704 17 7
351 3113895788 35 7
352 654825436 61 6
353 1452048 30 6
354 3147511625 7 6
355 3226664625 28 6
356 549184982 69 6
357 301209792 7 6
358 2545430247 25 6
359 2329375731 31 6
360 27075840 65 6
361 857978527 60 6
362 2424229017 26 6
363 3048263744 7 6
364 3433628561 29 5
365 517717050 36 5
366 495782506 19 5
367 483081978 36 5
368 27731896 20 5
369 3089095447 22 5
370 2310825263 15 4

View File

@ -1,73 +1,73 @@
id_product,count
50,9590
54,8910
53,8840
51,8780
52,8160
55,7860
99,6214
95,4398
46,3872
49,3872
47,3872
48,3872
45,3852
44,3852
90,1442
93,1400
94,1390
91,1390
43,732
92,700
39,696
40,686
38,662
41,512
42,472
7,150
11,40
23,40
20,40
69,40
68,40
67,40
15,40
74,40
52,5571
55,5513
51,4711
53,4687
50,4642
54,4622
95,3416
49,3272
46,3254
48,3233
44,3196
45,3195
47,3164
99,1384
94,1280
93,1174
91,1122
90,911
92,768
41,474
42,458
43,301
39,267
38,257
40,250
7,138
23,54
11,50
68,47
20,45
67,45
34,41
61,41
31,40
27,40
60,36
61,30
72,30
79,30
8,30
9,30
12,30
66,30
63,30
62,30
24,30
8,39
62,38
32,38
27,38
74,37
64,37
63,36
15,35
69,35
79,34
24,33
60,32
35,31
37,30
28,30
30,30
18,30
32,30
33,30
34,30
35,30
73,20
97,20
26,20
29,20
36,20
10,20
71,20
19,20
17,20
16,20
25,20
65,20
64,20
13,10
22,10
70,10
59,10
33,29
72,28
18,28
9,27
73,27
36,27
28,27
66,26
30,26
26,26
12,25
10,25
19,25
97,24
71,23
59,23
16,22
13,20
70,18
17,18
22,18
25,17
29,17
65,16

1 id_product count
2 50 52 9590 5571
3 54 55 8910 5513
4 53 51 8840 4711
5 51 53 8780 4687
6 52 50 8160 4642
7 55 54 7860 4622
8 99 95 6214 3416
9 95 49 4398 3272
10 46 3872 3254
11 49 48 3872 3233
12 47 44 3872 3196
13 48 45 3872 3195
14 45 47 3852 3164
15 44 99 3852 1384
16 90 94 1442 1280
17 93 1400 1174
18 94 91 1390 1122
19 91 90 1390 911
20 43 92 732 768
21 92 41 700 474
22 39 42 696 458
23 40 43 686 301
24 38 39 662 267
25 41 38 512 257
26 42 40 472 250
27 7 150 138
28 11 23 40 54
29 23 11 40 50
30 20 68 40 47
31 69 20 40 45
32 68 67 40 45
33 67 34 40 41
34 15 61 40 41
74 40
35 31 40
36 27 8 40 39
37 60 62 36 38
38 61 32 30 38
39 72 27 30 38
40 79 74 30 37
41 8 64 30 37
42 9 63 30 36
43 12 15 30 35
44 66 69 30 35
45 63 79 30 34
46 62 24 30 33
47 24 60 30 32
48 35 31
49 37 30
50 28 33 30 29
51 30 72 30 28
52 18 30 28
53 32 9 30 27
54 33 73 30 27
55 34 36 30 27
56 35 28 30 27
57 73 66 20 26
58 97 30 20 26
59 26 20 26
60 29 12 20 25
61 36 10 20 25
62 10 19 20 25
63 71 97 20 24
64 19 71 20 23
65 17 59 20 23
66 16 20 22
67 25 13 20
68 65 70 20 18
69 64 17 20 18
70 13 22 10 18
71 22 25 10 17
72 70 29 10 17
73 59 65 10 16

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 5.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 5.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 MiB

After

Width:  |  Height:  |  Size: 13 MiB

View File

@ -16,7 +16,7 @@ Jinja2==3.1.2
joblib==1.2.0
kiwisolver==1.4.4
MarkupSafe==2.1.2
matplotlib==3.7.5
matplotlib==3.3.4
matplotlib-inline==0.1.6
multiprocess==0.70.14
mysqlclient==2.1.1

View File

@ -13,7 +13,7 @@ count_dcp = pd.read_csv("output_result/risk/count_dcp.csv",
'up_id_firm': str,
'down_id_firm': str
})
count_dcp = count_dcp[count_dcp['count'] > 35]
count_dcp = count_dcp[count_dcp['count'] > 130]
list_firm = count_dcp['up_id_firm'].tolist(
) + count_dcp['down_id_firm'].tolist()
@ -42,7 +42,7 @@ nx.set_node_attributes(G_firm, firm_labels_dict)
count_max = count_dcp['count'].max()
count_min = count_dcp['count'].min()
k = 5 / (count_max - count_min)
k = 15 / (count_max - count_min)
for _, row in count_dcp.iterrows():
# print(row)
lst_add_edge = [(
@ -53,18 +53,43 @@ for _, row in count_dcp.iterrows():
'down_id_product': row['down_id_product'],
'edge_label': f"{row['up_id_product']} - {row['down_id_product']}",
'edge_width': k * (row['count'] - count_min),
'count': row['count']
'count': (row['count'])*18
})]
G_firm.add_edges_from(lst_add_edge)
# dcp_networkx
pos = nx.nx_agraph.graphviz_layout(G_firm, prog="dot", args="")
pos = nx.nx_agraph.graphviz_layout(G_firm, prog="twopi", args="")
node_label = nx.get_node_attributes(G_firm, '企业名称')
# desensitize
node_label = {key: f"{key} {value}" for key, value in node_label.items()}
node_label = {key: f"{key} " for key, value in node_label.items()}
node_label = {
'343012684': '59',
'2944892892': '165',
'3269039233': '194',
'503176785': '73',
'3111033905': '178',
'3215814536': '190',
'413274977': '64',
'2317841563': '131',
'2354145351': '157',
'653528340': '88',
'888395016': '104',
'3069206426': '174',
'3299144127': '197',
'2624175': '8',
'25685135': '24',
'2348941764': '151',
'750610681': '95',
'2320475044': '133',
'571058167': '78',
'152008168': '44',
'448033045': '66',
'2321109759': '134',
'3445928818': '213'
}
node_size = list(nx.get_node_attributes(G_firm, 'Revenue_Log').values())
node_size = list(map(lambda x: x ** 3, node_size))
node_size = list(map(lambda x: x * 10, node_size))
edge_label = nx.get_edge_attributes(G_firm, "edge_label")
edge_label = {(n1, n2): label for (n1, n2, _), label in edge_label.items()}
edge_width = nx.get_edge_attributes(G_firm, "edge_width")
@ -79,18 +104,25 @@ nx.draw(G_firm,
pos,
node_size=node_size,
labels=node_label,
font_size=2,
width=1,
font_size=8,
width=2,
edge_color=colors,
edge_cmap=cmap,
edge_vmin=vmin,
edge_vmax=vmax)
# nx.draw_networkx_edge_labels(G_firm, pos, font_size=6)
nx.draw_networkx_edge_labels(
G_firm,
pos,
edge_labels=edge_label,
font_size=5
)
sm = plt.cm.ScalarMappable(cmap=cmap, norm=plt.Normalize(vmin=vmin, vmax=vmax))
sm._A = []
position = fig.add_axes([0.95, 0.05, 0.01, 0.3])
cb = plt.colorbar(sm, fraction=0.01, cax=position)
cb.ax.tick_params(labelsize=4)
cb.outline.set_visible(False)
plt.savefig("output_result\\risk\\count_dcp_network_dot")
plt.savefig("output_result\\risk\\count_dcp_network")
plt.close()

View File

@ -29,7 +29,7 @@ for code in g_bom.nodes:
index_list = count_prod[count_prod['id_product'] == code].index.tolist()
index = index_list[0] if len(index_list) == 1 else -1
node_attr['count'] = count_prod['count'].get(index, 0)
node_attr['node_size'] = (count_prod['count'].get(index, 0) + 10) / 10
node_attr['node_size'] = (count_prod['count'].get(index, 0))/10
node_attr['node_color'] = count_prod['count'].get(index, 0)
labels_dict[code] = node_attr
nx.set_node_attributes(g_bom, labels_dict)
@ -45,9 +45,12 @@ colors = list(nx.get_node_attributes(g_bom, 'node_color').values())
vmin = min(colors)
vmax = max(colors)
cmap = plt.cm.Blues
# 创建绘图对象
fig = plt.figure(figsize=(10, 10), dpi=300)
nx.draw(g_bom,
pos,
ax = fig.add_subplot(111)
# 绘制网络图(优化样式参数)
nx.draw(g_bom, pos,
node_size=list(nx.get_node_attributes(g_bom, 'node_size').values()),
labels=node_labels,
font_size=3,
@ -55,14 +58,35 @@ nx.draw(g_bom,
cmap=cmap,
vmin=vmin,
vmax=vmax,
edge_color='grey')
edge_color='#808080', # 中性灰
width=0.3,
edgecolors='#404040',
linewidths=0.2)
# 创建颜色条(修正实现方式)
sm = plt.cm.ScalarMappable(cmap=cmap, norm=plt.Normalize(vmin=vmin, vmax=vmax))
sm._A = []
position = fig.add_axes([0.01, 0.05, 0.01, 0.3])
cb = plt.colorbar(sm, fraction=0.01, cax=position)
cb.ax.tick_params(labelsize=3)
cb.outline.set_visible(False)
plt.savefig("output_result\\risk\\count_prod_network")
sm.set_array([])
# 设置颜色条位置和样式
cax = fig.add_axes([0.88, 0.3, 0.015, 0.4]) # 右侧垂直对齐
cb = plt.colorbar(sm, cax=cax)
cb.ax.tick_params(labelsize=4, width=0.5, colors='#333333')
cb.outline.set_linewidth(0.5)
cb.set_label('Risk Level', fontsize=5, labelpad=2)
# 添加图元信息
ax.set_title("Production Risk Network", fontsize=6, pad=8, color='#2F2F2F')
plt.text(0.5, 0.02, 'Data: USTB Production System | Viz: DeepSeek-R1',
ha='center', fontsize=3, color='#666666',
transform=fig.transFigure)
# 调整边界和保存
plt.subplots_adjust(left=0.05, right=0.85, top=0.95, bottom=0.1) # 适应颜色条
plt.savefig(r"output_result/risk/count_prod_network.png", # 规范路径格式
dpi=600,
bbox_inches='tight',
pad_inches=0.05,
transparent=False)
plt.close()
# dcp_prod
@ -91,8 +115,6 @@ list_prod = list(set(list_prod))
BomNodes = pd.read_csv('input_data/input_product_data/BomNodes.csv')
BomNodes.set_index('Index', inplace=True)
BomNodes.loc[13].to_dict()
g_bom = nx.MultiDiGraph()
g_bom.add_nodes_from(list_prod)
@ -116,47 +138,86 @@ for _, row in count_dcp_prod.iterrows():
g_bom.add_edges_from(lst_add_edge)
# dcp_networkx
pos = nx.nx_agraph.graphviz_layout(g_bom, prog="dot", args="")
pos = nx.nx_agraph.graphviz_layout(g_bom, prog="twopi", args="")
node_labels = nx.get_node_attributes(g_bom, 'Name')
# rename node 1
# node_labels['1'] = '解决方案'
temp = {}
for key, value in node_labels.items():
temp[key] = str(key) + " " + value
node_labels = temp
node_labels ={
38: 'SiC Substrate',
39: 'GaN Substrate',
40: 'Si Substrate',
41: 'AlN Substrate',
42: 'DUV LED Substrate',
43: 'InP Substrate',
44: 'Mono-Si Wafer',
45: 'Poly-Si Wafer',
46: 'InP Cryst./Wafer',
47: 'SiC Cryst./Wafer',
48: 'GaAs Wafer',
49: 'GaN Cryst./Wafer',
50: 'Si Epi Wafer',
51: 'SiC Epi Wafer',
52: 'AlN Epi',
53: 'GaN Epi',
54: 'InP Epi',
55: 'LED Epi Wafer',
90: 'Power Devices',
91: 'Diode',
92: 'Transistor',
93: 'Thyristor',
94: 'Rectifier',
95: 'IC Fab',
99: 'Wafer Test'
}
colors = nx.get_edge_attributes(g_bom, "count")
colors = [w for (n1, n2, _), w in colors.items()]
vmin = min(colors)
vmax = max(colors)
cmap = plt.cm.Blues
pos_new = {}
for node, p in pos.items():
pos_new[node] = (p[1], p[0])
pos_new = {node: (p[1], p[0]) for node, p in pos.items()} # 字典推导式优化
fig = plt.figure(figsize=(6, 6), dpi=500)
# plt.subplots_adjust(right=0.7)
nx.draw(g_bom,
pos_new,
node_size=25,
fig = plt.figure(figsize=(8, 8), dpi=300)
plt.subplots_adjust(right=0.85) # 关键调整右侧保留15%空白
# 使用Axes对象精准控制
main_ax = fig.add_axes([0.1, 0.1, 0.75, 0.8]) # 主图占左75%宽上下各留10%边距
nx.draw(g_bom, pos_new,
ax=main_ax,
node_size=50,
labels=node_labels,
font_size=5,
width=0.5,
width=1.5,
edge_color=colors,
edge_cmap=cmap,
edge_vmin=vmin,
edge_vmax=vmax,
alpha=1)
plt.axis('off')
axis = plt.gca()
axis.set_xlim([1 * x for x in axis.get_xlim()])
axis.set_ylim([1 * y for y in axis.get_ylim()])
)
main_ax.axis('off')
# 颜色条定位系统
cbar_ax = fig.add_axes([0.86, 0.15, 0.015, 0.3]) # 右边缘86%位置底部15%起占30%高度
sm = plt.cm.ScalarMappable(cmap=cmap, norm=plt.Normalize(vmin=vmin, vmax=vmax))
sm._A = []
position = fig.add_axes([0.85, 0.75, 0.01, 0.2])
cb = plt.colorbar(sm, fraction=0.01, cax=position)
cb.ax.tick_params(labelsize=3)
cb.outline.set_visible(False)
plt.savefig("output_result\\risk\\count_dcp_prod_network")
sm._A = [] # 必需的空数组
# 微调颜色条样式
cbar = fig.colorbar(sm, cax=cbar_ax, orientation='vertical')
cbar.ax.tick_params(labelsize=4,
width=0.3, # 刻度线粗细
length=1.5, # 刻度线长度
pad=0.8) # 标签与条间距
cbar.outline.set_linewidth(0.5) # 边框线宽
# 输出前验证边界
print(f"Colorbar position: {cbar_ax.get_position().bounds}") # 应输出(0.86,0.15,0.015,0.3)
# 专业级保存参数
plt.savefig("output_result/risk/count_dcp_prod_network.png",
dpi=900,
bbox_inches='tight', # 自动裁剪白边
pad_inches=0.05, # 保留0.05英寸边距
metadata={'CreationDate': None}) # 避免时间戳污染元数据
plt.close()

View File

@ -40,12 +40,142 @@ if G_bom_str is None:
G_bom = nx.adjacency_graph(json.loads(G_bom_str))
pos = nx.nx_agraph.graphviz_layout(G_bom, prog="twopi", args="")
node_labels = nx.get_node_attributes(G_bom, 'Name')
node_labels = {
7: 'Si Raw Mtl.',
8: 'Photoresist & Reagents',
9: 'Etch Solution',
10: 'SiF4',
11: 'Developer',
12: 'PCE Superplasticizer',
13: 'Metal Protectant',
14: 'Deep Hole Cu Plating',
15: 'Thinner',
16: 'HP Boric Acid (Nuc.)',
17: 'E-Grade Epoxy',
18: 'Stripper',
19: 'HP-MOC',
20: 'CMP Slurry & Consumables',
21: 'PR Remover',
22: 'Poly-Si Cutting Fluid',
23: 'Passivation',
24: 'E-Grade Phenolic',
25: 'Surfactant',
26: 'Mag. Carrier',
27: 'Wet Chems.',
28: 'Plating Chems.',
29: 'E-FR Materials',
30: 'LC Alignment Agent',
31: 'Func. Wet Chems.',
32: 'InP',
33: 'SiC',
34: 'GaAs',
35: 'GaN',
36: 'AlN',
37: 'Si3N4',
38: 'SiC Substrate',
39: 'GaN Substrate',
40: 'Si Wafer',
41: 'AlN Substrate',
42: 'DUV LED Substrate',
43: 'InP Substrate',
44: 'Mono-Si Wafer',
45: 'Poly-Si Wafer',
46: 'InP Cryst./Wafer',
47: 'SiC Cryst./Wafer',
48: 'GaAs Wafer',
49: 'GaN Cryst./Wafer',
50: 'Si Epi Wafer',
51: 'SiC Epi Wafer',
52: 'AlN Epi',
53: 'GaN Epi',
54: 'InP Epi',
55: 'LED Epi',
56: 'EDA/IP',
57: 'MPW Service',
58: 'IC Design',
59: 'Track System',
60: 'Wafer Grinder',
61: 'Etcher',
62: 'Ox/Diff Furnace',
63: 'Wafer Metrology',
64: 'Crystal Grower',
65: 'CMP Tool',
66: 'Stepper',
67: 'Wafer Dicer',
68: 'Deposition System',
69: 'Edge Profiler',
70: 'Descum Tool',
71: 'Clean System',
72: 'SAF',
73: 'Plating Eqpt.',
74: 'Implanter',
75: 'Trim/Form',
76: 'Probe Card',
77: 'ATE',
78: 'PCM Eqpt.',
79: 'Inspection Sys.',
80: 'Prober',
81: 'Dicing Saw',
82: 'Handler',
83: 'Backgrinder',
84: 'Die Bonder',
85: 'Reflow Oven',
86: 'FT Tester',
87: 'Wire Bonder',
88: 'BGA Mounter',
89: 'Molding Press',
90: 'Power Devices',
91: 'Diode',
92: 'Transistor',
93: 'Thyristor',
94: 'Rectifier',
95: 'IC Fab',
96: 'IC PKG',
97: 'DV',
98: 'IPM',
99: 'CP Test',
100: 'FT Test',
101: 'Bumping',
102: 'DA Materials',
103: 'Leadframe',
104: 'Solder Ball',
105: 'Substrate',
106: 'EMC',
107: 'Bond Wire',
108: 'Underfill',
109: 'Dicing Tape'
}
plt.figure(figsize=(12, 12), dpi=500)
plt.axis('off') # 关闭坐标轴边框
plt.figure(figsize=(12, 12), dpi=300)
nx.draw_networkx_nodes(G_bom, pos)
nx.draw_networkx_edges(G_bom, pos)
nx.draw_networkx_labels(G_bom, pos, labels=node_labels, font_size=3)
plt.savefig(f"output_result/risk/g_bom_exp_id_{exp_id}.png")
# 优化节点绘制参数
nx.draw_networkx_nodes(
G_bom, pos,
node_size=100, # 优化节点尺寸
linewidths=0.0 # 去除节点边框
)
# 优化边绘制参数
nx.draw_networkx_edges(
G_bom, pos,
width=0.3, # 更细的边宽
alpha=0.5 # 半透明边
)
# 优化标签参数
nx.draw_networkx_labels(
G_bom, pos,
labels=node_labels,
font_size=3, # 适当增大字号
font_family='sans-serif', # 使用无衬线字体
font_weight='bold', # 增强可读性
)
# 专业级保存参数设置
plt.savefig(
f"output_result/risk/g_bom_exp_id_{exp_id}.png",
bbox_inches='tight', # 去除图像白边
pad_inches=0.1, # 适当内边距
facecolor='white' # 保证背景纯白
)
plt.close()
# G_firm
@ -77,14 +207,228 @@ G_firm.remove_nodes_from(isolated_nodes) # 从图中移除这些节点
# 2. 重新布局和绘图
pos = nx.nx_agraph.graphviz_layout(G_firm, prog="twopi", args="")
node_label = {key: key for key in nx.get_node_attributes(G_firm, 'Revenue_Log').keys()}
node_size = [value * 10 for value in nx.get_node_attributes(G_firm, 'Revenue_Log').values()] # 节点大小扩大10倍
node_label = {
"7": "1",
"9": "2",
"829768": "4",
"863079": "5",
"1452048": "6",
"2010673": "7",
"2624175": "8",
"2728939": "9",
"5278074": "10",
"5849940": "11",
"7299120": "12",
"9746245": "13",
"11807506": "14",
"15613202": "15",
"24284343": "19",
"24673506": "20",
"25036634": "21",
"25685135": "24",
"25945288": "25",
"26162741": "26",
"26516263": "27",
"27075840": "28",
"27731896": "29",
"29954548": "30",
"43407343": "33",
"70634828": "36",
"71271700": "37",
"80158773": "39",
"118882692": "40",
"145511905": "42",
"151606446": "43",
"152008168": "44",
"159511306": "45",
"191912252": "46",
"194210021": "47",
"203314437": "48",
"213386023": "49",
"218633337": "50",
"251189644": "53",
"271860868": "55",
"278221281": "56",
"301209792": "57",
"343012684": "59",
"354897041": "60",
"400488703": "62",
"400692942": "63",
"413274977": "64",
"420984285": "65",
"448033045": "66",
"453289520": "67",
"474279224": "68",
"483081978": "69",
"495782506": "70",
"503176785": "73",
"549184982": "75",
"560866402": "76",
"561545339": "77",
"571058167": "78",
"581407487": "79",
"591452402": "80",
"593312758": "81",
"594378026": "82",
"607512171": "83",
"615763365": "84",
"620220747": "85",
"631449822": "86",
"644292599": "87",
"653528340": "88",
"654825436": "89",
"688155470": "92",
"695995052": "93",
"750610681": "95",
"762985858": "96",
"771821595": "97",
"857978527": "100",
"868012326": "101",
"887840774": "102",
"888356483": "103",
"888395016": "104",
"888478182": "105",
"930767828": "107",
"996174506": "108",
"1033972427": "110",
"1128343125": "111",
"1217957486": "113",
"1307012237": "115",
"1375606900": "116",
"1549474227": "118",
"1606833003": "120",
"1679596339": "121",
"2310825263": "122",
"2311838590": "124",
"2312490120": "125",
"2316990095": "128",
"2317245827": "129",
"2317841563": "131",
"2320102626": "132",
"2320475044": "133",
"2321109759": "134",
"2324787028": "137",
"2324844174": "138",
"2326478786": "139",
"2327031723": "140",
"2327979389": "141",
"2329375731": "142",
"2333843479": "143",
"2337952436": "146",
"2339188563": "147",
"2339684065": "148",
"2341555098": "149",
"2343704209": "150",
"2348941764": "151",
"2352036411": "155",
"2354145351": "157",
"2424229017": "159",
"2545430247": "161",
"2820140348": "163",
"2944892892": "165",
"3025036704": "168",
"3026382513": "169",
"3045721313": "171",
"3047163873": "172",
"3048263744": "173",
"3069206426": "174",
"3070859372": "175",
"3072715478": "176",
"3103797386": "177",
"3111033905": "178",
"3113895788": "179",
"3120341363": "180",
"3122923980": "181",
"3127420424": "182",
"3133307899": "183",
"3147511625": "184",
"3177507356": "185",
"3188903709": "186",
"3195502499": "187",
"3203777710": "188",
"3211956484": "189",
"3215814536": "190",
"3221190269": "191",
"3226664625": "192",
"3267688490": "193",
"3269039233": "194",
"3269940677": "195",
"3271705843": "196",
"3299144127": "197",
"3312358902": "198",
"3344297292": "200",
"3372913783": "201",
"3373311444": "202",
"3384021594": "203",
"3395900897": "205",
"3398677646": "206",
"3407754893": "207",
"3433628561": "209",
"3445244192": "212",
"3445928818": "213",
"4208851809": "216",
"5007015990": "218",
"11164476478": "219",
"517717050": "223",
"737770776": "224",
"872394725": "225",
"2311581270": "226",
"2313209417": "227",
"2347013470": "228",
"2350418059": "229",
"3031009366": "234",
"3089095447": "235",
"3100891962": "236",
"3188352290": "238",
"3288105727": "239",
"3462551351": "240"
}
node_size = [value * 5 for value in nx.get_node_attributes(G_firm, 'Revenue_Log').values()]
edge_label = {(n1, n2): label for (n1, n2, _), label in nx.get_edge_attributes(G_firm, "Product").items()}
plt.figure(figsize=(12, 12), dpi=500)
nx.draw(G_firm, pos, node_size=node_size, labels=node_label, font_size=5, width=0.5)
nx.draw_networkx_edge_labels(G_firm, pos, edge_label, font_size=2)
plt.axis('equal') # 锁定坐标轴比例,确保图形内容是正方形
plt.savefig(f"output_result/risk/g_firm_sample_id_{sample_id}_de.png", bbox_inches='tight', pad_inches=0.1)
plt.figure(figsize=(15, 15), dpi=500)
plt.axis('off') # 完全关闭坐标轴系统
# 分层绘制网络组件
nodes = nx.draw_networkx_nodes(
G_firm, pos,
node_size=node_size, # 保持原始尺寸设置
)
edges = nx.draw_networkx_edges(
G_firm, pos,
width=0.3, # 保持原始线宽设置
)
# 优化节点标签
labels = nx.draw_networkx_labels(
G_firm, pos,
labels=node_label,
font_size=6, # 保持原始字号
)
# 增强边标签可读性
edge_labels = nx.draw_networkx_edge_labels(
G_firm, pos,
edge_labels=edge_label,
font_size=2,
label_pos=0.5, # 标签沿边偏移量
rotate=False, # 禁止自动旋转
)
# 专业级输出配置
plt.savefig(
f"output_result/risk/g_firm_sample_id_{sample_id}_de.png",
bbox_inches='tight',
pad_inches=0.05, # 更紧凑的边距
facecolor='white', # 强制白色背景
metadata={
'Title': f"Supply Chain Risk Map - Sample {sample_id}",
'Author': 'USTB Risk Analytics',
'Copyright': 'Confidential'
}
)
plt.close()

View File

@ -0,0 +1,50 @@
import pandas as pd
# 读取数据
df = pd.read_csv('input_data/input_firm_data/firm_amended.csv') # 替换为你的 CSV 文件路径
# 要分析的列
columns = [
"固定资产原值(万元人民币)",
"固定资产净值(万元人民币)",
"资产总和(万元人民币)",
"存货(万元人民币)"
]
# 字段类型定义(可人工定义,也可自动判断)
column_types = {
"固定资产原值(万元人民币)": "连续型",
"固定资产净值(万元人民币)": "连续型",
"资产总和(万元人民币)": "连续型",
"存货(万元人民币)": "连续型"
}
# 统计分析
summary = []
for col in columns:
data = df[col].dropna()
summary.append({
"字段名": col,
"类型": column_types[col],
"计数(非空)": data.count(),
"均值": data.mean(),
"标准差": data.std(),
"最小值": data.min(),
"中位数": data.median(),
"最大值": data.max()
})
# 转为 DataFrame 展示
summary_df = pd.DataFrame(summary)
# 设置列顺序
summary_df = summary_df[["字段名", "类型", "计数(非空)", "均值", "标准差", "最小值", "中位数", "最大值"]]
# 打印结果
print(summary_df)
# 保存为 Excel 文件
output_path = "企业规模数据描述性统计表.xlsx"
summary_df.to_excel(output_path, index=False)
print(f"统计结果已保存为 Excel 文件:{output_path}")

Binary file not shown.

View File

@ -46,7 +46,7 @@ def visualize_progress():
ax.text(i, v + 0.5, str(v), ha='center', fontsize=12)
# 刷新绘图
plt.pause(3) # 暂停一段时间以更新图表
plt.pause(0) # 暂停一段时间以更新图表
# 关闭窗口时,停止交互模式
# plt.ioff()

115
绘制度.py Normal file
View File

@ -0,0 +1,115 @@
import pickle
import pandas as pd
import networkx as nx
import matplotlib.pyplot as plt
# 1. 读取并处理数据
bom_nodes = pd.read_csv('input_data/input_product_data/BomNodes.csv')
bom_nodes['Code'] = bom_nodes['Code'].astype(str)
bom_nodes.set_index('Index', inplace=True)
bom_cate_net = pd.read_csv('input_data/input_product_data/合成结点.csv')
# 2. 构建图结构
g_bom = nx.from_pandas_edgelist(bom_cate_net, source='UPID', target='ID', create_using=nx.MultiDiGraph())
# 填充每一个结点的具体内容
bom_labels_dict = {}
for index in g_bom.nodes:
try:
bom_labels_dict[index] = bom_nodes.loc[index].to_dict()
except KeyError:
print(f"节点 {index} 不存在于 bom_nodes 中")
# 分配属性给每一个结点
nx.set_node_attributes(g_bom, bom_labels_dict)
# 3. 计算每个节点的度数
degrees = dict(g_bom.degree()) # 总度数(适用于有向图)
# 4. 统计每个度数的节点数量
degree_counts = {}
for degree in degrees.values():
if degree in degree_counts:
degree_counts[degree] += 1
else:
degree_counts[degree] = 1
# 转换为排序后的列表(横坐标:度数,纵坐标:节点数)
sorted_degrees = sorted(degree_counts.keys())
sorted_counts = [degree_counts[d] for d in sorted_degrees]
# 5. 绘制度分布图
plt.figure(figsize=(12, 8)) # 增大画布尺寸
bars = plt.bar(sorted_degrees, sorted_counts, width=0.8)
plt.title('Degree Distribution In Industrial Chain', fontsize=16)
plt.xlabel('Degree', fontsize=14)
plt.ylabel('Number of Nodes', fontsize=14)
plt.grid(True, linestyle='--', alpha=0.5)
plt.xticks(rotation=45) # 如果度数较多可以旋转x轴标签
plt.tight_layout() # 防止标签重叠
# 6. 在每个柱子上方标注数值
for bar in bars:
height = bar.get_height()
plt.text(
bar.get_x() + bar.get_width() / 2, # x坐标柱子中心
height + max(sorted_counts) * 0.02, # y坐标柱子顶部上方留出空间
f'{int(height)}', # 显示数值(转换为整数)
ha='center', # 水平居中
va='bottom', # 垂直底部对齐
fontsize=10, # 字体大小
color='black' # 字体颜色
)
# 7. 保存超高清图片300 DPI
output_path = "degree_distribution_with_labels.png" # 输出文件名
plt.savefig(output_path, dpi=500, bbox_inches='tight') # dpi=300 确保高分辨率
print(f"图片已保存至: {output_path}")
# 1. 加载企业网络数据
with open("firm_network.pkl", 'rb') as f:
G_firm = pickle.load(f)
print(f"Successfully loaded cached data from firm_network.pkl")
# 2. 计算企业网络的度分布
degrees_firm = dict(G_firm.degree()) # 总度数
degree_counts_firm = {}
for degree in degrees_firm.values():
if degree in degree_counts_firm:
degree_counts_firm[degree] += 1
else:
degree_counts_firm[degree] = 1
# 转换为排序后的列表
sorted_degrees_firm = sorted(degree_counts_firm.keys())
sorted_counts_firm = [degree_counts_firm[d] for d in sorted_degrees_firm]
# 3. 绘制企业网络的度分布图
plt.figure(figsize=(12, 6)) # 单独画布尺寸
plt.bar(sorted_degrees_firm, sorted_counts_firm, width=0.8)
plt.title('Degree Distribution of Firm Network', fontsize=16)
plt.xlabel('Degree (Number of Connections)', fontsize=14)
plt.ylabel('Number of Firms', fontsize=14)
plt.grid(True, linestyle='--', alpha=0.5)
plt.xticks(rotation=45)
plt.tight_layout()
# 在柱子上方标注数值
for bar in plt.gca().containers[0]: # 获取当前图中的柱子对象
height = bar.get_height()
plt.text(
bar.get_x() + bar.get_width() / 2,
height + max(sorted_counts_firm) * 0.02,
f'{int(height)}',
ha='center',
va='bottom',
fontsize=10,
color='black'
)
# 保存图片
plt.savefig("degree_distribution_firm.png", dpi=500, bbox_inches='tight')
print("企业度分布图已保存至: degree_distribution_firm.png")