Skip to content

Instantly share code, notes, and snippets.

@aletelecom
aletelecom / .py
Created July 31, 2022 17:56
Viz 4 dataset creation
data_df = pd.DataFrame([distance, np.sort(optical_power)])
data_df = data_df.T
data_df.rename(columns={0:'distance', 1:'optical_power'}, inplace=True)
#data_df['avg_speed'] = data_df['throughput'].divide(data_df['client_qty'])
data_df
@aletelecom
aletelecom / .py
Created July 31, 2022 18:38
Viz 4 visualization
def double_hist_and_scatter_plot(df):
# Auxilliary parameters for the plot, number of bins
w = 2
n = math.ceil((df['optical_power'].max() - df['optical_power'].min()) / w)
# definitions for the axes limits and positions
left, width = 0.1, 0.65
bottom, height = 0.1, 0.65
spacing = 0.005
@aletelecom
aletelecom / .py
Created July 31, 2022 18:50
Viz 4 function call
double_hist_and_scatter_plot(data_df)