|
425 | 425 | "outputs": [], |
426 | 426 | "source": [ |
427 | 427 | "external_package_usage_per_type_distribution = query_cypher_to_data_frame(\"../cypher/External_Dependencies/External_package_usage_per_type_distribution.cypher\")\n", |
428 | | - "external_package_usage_per_type_distribution[['artifactName', 'artifactTypes', 'numberOfExternalPackages', 'numberOfTypes', 'numberOfTypesPercentage']].head(20)" |
| 428 | + "external_package_usage_per_type_distribution_truncated=external_package_usage_per_type_distribution[['artifactName', 'artifactPackages', 'artifactTypes', 'numberOfExternalPackages', 'numberOfTypes', 'typesCallingExternalRate', 'packagesCallingExternalRate']].head(20)\n", |
| 429 | + "external_package_usage_per_type_distribution_truncated" |
429 | 430 | ] |
430 | 431 | }, |
431 | 432 | { |
|
447 | 448 | "outputs": [], |
448 | 449 | "source": [ |
449 | 450 | "\n", |
450 | | - "# Organize artifacts in columns with the number of types as values using pivot\n", |
| 451 | + "# Organize artifacts in columns with the number of package that call external packages as values using pivot\n", |
451 | 452 | "# Every row represents the number of external packages\n", |
452 | | - "external_package_usage_per_type_distribution=external_package_usage_per_type_distribution.pivot(index='numberOfExternalPackages', columns='artifactName', values='numberOfTypesPercentage')\n", |
| 453 | + "external_package_usage_per_type_distribution_for_each_artifact=external_package_usage_per_type_distribution.pivot(index='numberOfExternalPackages', columns='artifactName', values='packagesCallingExternalRate')\n", |
453 | 454 | "\n", |
454 | 455 | "# Fill missing values with zero\n", |
455 | | - "external_package_usage_per_type_distribution.fillna(0, inplace=True)\n", |
| 456 | + "external_package_usage_per_type_distribution_for_each_artifact.fillna(0, inplace=True)\n", |
456 | 457 | "\n", |
457 | | - "# Convert to integer\n", |
458 | | - "# external_package_usage_per_type_distribution=external_package_usage_per_type_distribution.astype(int)\n", |
459 | | - "\n", |
460 | | - "external_package_usage_per_type_distribution.head(10)" |
| 458 | + "external_package_usage_per_type_distribution_for_each_artifact" |
461 | 459 | ] |
462 | 460 | }, |
463 | 461 | { |
|
479 | 477 | "outputs": [], |
480 | 478 | "source": [ |
481 | 479 | "plot.figure();\n", |
482 | | - "axes = external_package_usage_per_type_distribution.plot(\n", |
| 480 | + "axes = external_package_usage_per_type_distribution_for_each_artifact.plot(\n", |
483 | 481 | " kind='bar', \n", |
484 | 482 | " grid=True,\n", |
485 | 483 | " title='Relative External Package Usage', \n", |
486 | 484 | " xlabel='external package count',\n", |
487 | | - " ylabel='percentage of types',\n", |
| 485 | + " ylabel='percentage of package',\n", |
488 | 486 | " cmap=main_color_map,\n", |
489 | 487 | ")\n", |
490 | 488 | "plot.show()" |
|
509 | 507 | "outputs": [], |
510 | 508 | "source": [ |
511 | 509 | "plot.figure();\n", |
512 | | - "axes = external_package_usage_per_type_distribution.transpose().plot(\n", |
| 510 | + "axes = external_package_usage_per_type_distribution_for_each_artifact.transpose().plot(\n", |
513 | 511 | " kind='bar', \n", |
514 | 512 | " grid=True,\n", |
515 | 513 | " title='Relative External Package Usage', \n", |
516 | 514 | " xlabel='artifact',\n", |
517 | | - " ylabel='percentage of types',\n", |
| 515 | + " ylabel='percentage of packages',\n", |
518 | 516 | " stacked=True,\n", |
519 | 517 | " cmap=main_color_map,\n", |
520 | 518 | ")\n", |
|
0 commit comments