<jupyter_start><jupyter_text><jupyter_code>import pandas as pd
import io
raw_data = b'''\
File,HTTP,HTTP Cached,stashcp,stashcp Cached
95perc.data,25268,30353,83570,69256
25perc.data,2111,1612,5927,7631
1perc.data,1286,26,1885,1092
big_blast.data,130915,107020,255721,281148
50perc.data,9075,4434,19711,14667
75perc.data,5935,4970,48361,10381
5perc.data,1625,267,2283,1424
'''
df = pd.read_csv(io.BytesIO(raw_data))
df
data_sizes = {'1perc.data': 5936, 
              '25perc.data': 178257920,
              '50perc.data': 490733568,
              '5perc.data': 24117248,
              '75perc.data': 516947968,
              '95perc.data': 2448424960,
              'big_blast.data': 10485760000}
new_column = []
for row in df.iterrows():
  #print(row[1])
  new_column.append(data_sizes[row[1]["File"]])
print(new_column)
df['File Sizes'] = new_column
df
df2 = pd.melt(df, id_vars=['File Sizes'], value_vars=['HTTP', 'HTTP Cached', 'stashcp', 'stashcp Cached'])
df3 = df2.rename(index=str, columns={"variable": "Transfer", "value": "Time"})
df3['File Sizes'] = df3["File Sizes"] / (1024*1024)
df3
from altair import *
import altair as alt



base = alt.Chart(df3).properties(width=600)
line = base.mark_line().encode(
    x=X('File Sizes:Q', scale=alt.Scale(type='log', base=2)),
    y=Y('Time:Q',scale=alt.Scale(type='log', base=2)),
    color=Color('Transfer:O', scale=alt.Scale(scheme='dark2'))
)
line
df
df["HTTP"] = df['File Sizes'] / (df['HTTP'] / 1000)
df["HTTP Cached"] = df['File Sizes'] / (df['HTTP Cached'] / 1000)
df["stashcp"] = df['File Sizes'] / (df['stashcp'] / 1000)
df["stashcp Cached"] = df['File Sizes'] / (df['stashcp Cached'] / 1000)
df
df = df.sort_values('File Sizes')
df
df2 = df.drop(2)
df3 = pd.melt(df2, id_vars=['File Sizes'], value_vars=['HTTP', 'HTTP Cached', 'stashcp', 'stashcp Cached'])


df3 = df3.rename(index=str, columns={"variable": "Transfer", "value": "Speed"})
df3['File Sizes'] = df3['File Sizes'] / (1024*1024)
df3['Speed'] = df3['Speed']*8 / (1024*1024)
df3
alt.Chart(df3).mark_bar().encode(
    column=Column('File Sizes:O', title="File Sizes (MB)"),
    x=X('Transfer:O', axis=alt.Axis(title='Transfer')),
    y=Y('Speed:Q', axis=alt.Axis(title="Transfer Speed (mbps)")),
    color=Color('Transfer:N', legend=None)
)

#df2 = df.drop(2)
#df3 = pd.melt(df2, id_vars=['File Sizes'], value_vars=['HTTP', 'HTTP Cached', 'stashcp', 'stashcp Cached'])
df2 = df.drop([6, 1, 4, 5, 0, 3])
df3 = pd.melt(df2, id_vars=['File Sizes'], value_vars=['HTTP', 'HTTP Cached', 'stashcp', 'stashcp Cached'])
df3
df3 = df3.rename(index=str, columns={"variable": "Transfer", "value": "Speed"})
df3['Speed'] = df3['Speed']*8 / (1024*1024)
df3
alt.Chart(df3).mark_bar().encode(
    x=X('Transfer:O', axis=alt.Axis(title='Transfer')),
    y=Y('Speed:Q', axis=alt.Axis(title="Transfer Speed (mbps)")),
    color=Color('Transfer:N', legend=None)
)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2122885743872972, 'fraction_numerical': 0.10424577148774594, 'mean_word_length': 5.46875, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '223922', 'license': 'Apache-2.0', 'n_tokens_mistral': 1365, 'n_tokens_neox': 1195, 'n_words': 211, 'path': 'StashCache_Comparison_Speeds.ipynb', 'repo_name': 'djw8605/Pearc19-StashCache-Tools', 'size': '2897'}