|
1082 | 1082 | "source": [
|
1083 | 1083 | "# for each device, plot a bar that shows the data traffic (incoming and outgoing) and amount of packets\n",
|
1084 | 1084 | "# aggregate data\n",
|
1085 |
| - "df_device_in_total = (df_device_traffic.iloc[::2].agg(['sum']) // 1000).transpose()# even rows, incoming traffic\n", |
1086 |
| - "df_device_out_total = (df_device_traffic.iloc[1::2].agg(['sum']) //1000).transpose()# odd rows, outgoing traffic\n", |
| 1085 | + "df_device_in_total = (df_device_traffic.iloc[::2].agg(['sum']) // 1000000).transpose()# even rows, incoming traffic, convert to MB\n", |
| 1086 | + "df_device_out_total = (df_device_traffic.iloc[1::2].agg(['sum']) //1000000).transpose()# odd rows, outgoing traffic, convert to MB\n", |
1087 | 1087 | "\n",
|
1088 | 1088 | "df_device_in_total_num = df_device_in_total['sum'].to_numpy()\n",
|
1089 | 1089 | "df_device_out_total_num = df_device_out_total['sum'].to_numpy()\n",
|
|
1096 | 1096 | "# plot data traffic per device\n",
|
1097 | 1097 | "fig, ax = plt.subplots(figsize=(15,5))\n",
|
1098 | 1098 | "plt.xlabel('Devices')\n",
|
1099 |
| - "plt.ylabel('Data [kB]')\n", |
| 1099 | + "plt.ylabel('Data [MB]')\n", |
1100 | 1100 | "plt.title('Data traffic per Device')\n",
|
1101 | 1101 | "plot_x_devices_traffic = np.arange(len(devices_labels))\n",
|
1102 | 1102 | "plt.xticks(plot_x_devices_traffic, devices_labels, rotation=60, ha=\"right\")\n",
|
|
0 commit comments