-
-
Save aletelecom/c8c1c95a79a728f0c8ee06051e83d54b to your computer and use it in GitHub Desktop.
Creating the viz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plt.rcParams.update({'font.size':14, 'figure.figsize': (25,20)}) | |
grouped_olts = concat_df.groupby(['port', 'slot', 'model'])['client_qty'].mean().reset_index() | |
grouped_olts.sort_values(by='model', inplace=True) | |
models = list(concat_df['model'].unique()) | |
olts = [] | |
for model in models: | |
o = grouped_olts[grouped_olts['model']==model] | |
olts.append(o) | |
olt_list = [] | |
for olt in olts: | |
individual = olt.pivot(index='port', columns='slot', values='client_qty') | |
olt_list.append(individual) | |
fig, axes = plt.subplots(2, 2, figsize=(20,15)) | |
for (i, axs, olt, modelo) in zip(range(4), axes.flatten(), olt_list, models): | |
sns.heatmap(olt, vmin=0, vmax=64, cmap='RdYlGn_r', linewidths=0.5, annot=True, ax=axs) | |
axs.set_title(modelo, fontsize=20) | |
fig.tight_layout(pad=2) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment