<jupyter_start><jupyter_text>Useful linkshttps://color.adobe.com/createhttp://mkweb.bcgsc.ca/tableviewer/Settings- labels    - segment        - parallel = no        - font = normal        - size = med- row and column segments    - thickness = thin    - spacing = tight    - radius = small    - order = name    - progression = desc    - normalize = no- constribution tracks    - hide = true    - expand = false    - no stroke = true- ribbon caps    - hide ribbon caps by row = true    - hide ribbon caps by col = true    - no stroke = true- image format    - start seg at 3 = false    - hide first tick label = true    - no stroke on any elements = false    - draw last tick = false    - hide segment labels = false    - hide absolute tick marks = true    - hide all tick labels = true    - hide relative tick marks = true- colors    - color ribbons by = row    - color ribbons by value = no- (Rest are default)When loading in file, select-  color     - col with row colors = true    - row with col colors  = true    - (rest are false)  Dataset<jupyter_code>import os
import numpy as np
import pandas as pd
from IPython.display import display

path = './data'

df = pd.read_csv(os.path.join(path,'scale_s2_2.csv'))
display(df)
labels = ['pooled','reciprocal','sequential']

code = {
    'tool': 0,
    'machine': 1,
    'subordinate': 2,
    'colleague': 3,
    'coleague': 3,
    'collaborator': 4,
    'teammate': 5
}

roles = df[['robot_role_before_label','robot_role_after_label']].applymap(lambda x: code[x])
conditions = df['condition'].apply(lambda x: labels[x-1])

data = pd.concat([conditions, roles], axis=1)
display(data)
pooled = data.loc[data['condition'] == 'pooled']
pooledResult = np.zeros((6,6))

for index, row in pooled.iterrows():
    pooledResult[row['robot_role_before_label'],row['robot_role_after_label']] += 1

display(pooledResult)
np.sum(pooledResult)
sequential = data.loc[data['condition'] == 'sequential']
sequentialResult = np.zeros((6,6))

for index, row in sequential.iterrows():
    sequentialResult[row['robot_role_before_label'],row['robot_role_after_label']] += 1

display(sequentialResult)
np.sum(sequentialResult)
reciprocal = data.loc[data['condition'] == 'reciprocal']
reciprocalResult = np.zeros((6,6))

for index, row in reciprocal.iterrows():
    reciprocalResult[row['robot_role_before_label'],row['robot_role_after_label']] += 1

display(reciprocalResult)
np.sum(reciprocalResult)<jupyter_output><empty_output><jupyter_text>Combined Plots<jupyter_code>print("data data 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50") 
print("data data Tool Machine Subordinate Colleague Collaborator Teammate")


rowLabels = ['Tool','Machine','Subordinate','Colleague','Collaborator','Teammate']
conditionLabels = ['P','S','R']
colors = ['28,145,236', '236,28,36', '150,250,87']

for c in range(0,3):
    for i in range(0,6):
        s = "{} {}-{}".format(colors[c], rowLabels[i],conditionLabels[c])
        for j in range(0,6):
            if c == 0:
                s += " {}".format(int(pooledResult[i,j]))
            elif c == 1:
                s += " {}".format(int(sequentialResult[i,j]))
            else:
                s += " {}".format(int(reciprocalResult[i,j]))
        print(s)

print("data data 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50") 
print("data data Tool Machine Subordinate Colleague Collaborator Teammate")


rowLabels = ['Tool','Machine','Subordinate','Colleague','Collaborator','Teammate']
conditionLabels = ['P','S','R']
colors = {
    0: {
        0: '255,134,77',
        1: '230,120,69',
        2: '191,100,57'
    },
    1: {
        0: '137,255,123',
        1: '102,191,92',
        2: '68,128,61'
    },
    2: {
        0: '255,90,232',
        1: '191,67,175',
        2: '128,45,116'
    },
    3: {
        0: '83,117,255',
        1: '63,89,191',
        2: '42,59,128'
    },
    4: {
        0: '106,255,240',
        1: '80,191,180',
        2: '54,128,120'
    },
    5: {
        0: '210,215,250',
        1: '188,193,224',
        2: '156,160,186'
    }
}

for c in range(0,3):
    for i in range(0,6):
        s = "{} {}-{}".format(colors[i][c], rowLabels[i],conditionLabels[c])
        for j in range(0,6):
            if c == 0:
                s += " {}".format(int(pooledResult[i,j]))
            elif c == 1:
                s += " {}".format(int(sequentialResult[i,j]))
            else:
                s += " {}".format(int(reciprocalResult[i,j]))
        print(s)<jupyter_output>data data 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50
data data Tool Machine Subordinate Colleague Collaborator Teammate
255,134,77 Tool-P 0 0 0 1 1 2
137,255,123 Machine-P 1 1 0 0 0 1
255,90,232 Subordinate-P 0 0 0 0 0 0
83,117,255 Colleague-P 0 0 0 0 0 1
106,255,240 Collaborator-P 0 0 0 0 0 1
210,215,250 Teammate-P 0 0 0 2 0 0
230,120,69 Tool-S 0 2 0 0 0 0
102,191,92 Machine-S 1 1 0 0 0 1
191,67,175 Subordinate-S 0 0 0 0 0 0
63,89,191 Colleague-S 0 0 0 0 0 0
80,191,180 Collaborator-S 0 0 0 0 1 0
188,193,224 Teammate-S 0 0 0 0 2 2
191,100,57 Tool-R 0 0 0 0 0 1
68,128,61 Machine-R 0 1 0 1 1 1
128,45,116 Subordinate-R 0 0 0 1 0 0
42,59,128 Colleague-R 0 0 0 0 0 0
54,128,120 Collaborator-R 0 0 0 0 2 1
156,160,186 Teammate-R 0 0 0 0 0 1<jupyter_text>Pooled Plot<jupyter_code>print("data data 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50") 
print("data data Tool Machine Subordinate Colleague Collaborator Teammate")


rowLabels = ['Tool','Machine','Subordinate','Colleague','Collaborator','Teammate']
colors = {
    0: '255,134,77',
    1: '137,255,123',
    2: '255,90,232',
    3: '83,117,255',
    4: '106,255,240',
    5: '210,215,250'
}

for i in range(0,6):
    s = "{} {}".format(colors[i], rowLabels[i])
    for j in range(0,6):
        s += " {}".format(int(pooledResult[i,j]))
    print(s)<jupyter_output>data data 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50
data data Tool Machine Subordinate Colleague Collaborator Teammate
255,134,77 Tool 0 0 0 1 1 2
137,255,123 Machine 1 1 0 0 0 1
255,90,232 Subordinate 0 0 0 0 0 0
83,117,255 Colleague 0 0 0 0 0 1
106,255,240 Collaborator 0 0 0 0 0 1
210,215,250 Teammate 0 0 0 2 0 0<jupyter_text>Reciprocal Plot<jupyter_code>print("data data 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50") 
print("data data Tool Machine Subordinate Colleague Collaborator Teammate")


rowLabels = ['Tool','Machine','Subordinate','Colleague','Collaborator','Teammate']
colors = {
    0: '255,134,77',
    1: '137,255,123',
    2: '255,90,232',
    3: '83,117,255',
    4: '106,255,240',
    5: '210,215,250'
}

for i in range(0,6):
    s = "{} {}".format(colors[i], rowLabels[i])
    for j in range(0,6):
        s += " {}".format(int(reciprocalResult[i,j]))
    print(s)<jupyter_output>data data 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50
data data Tool Machine Subordinate Colleague Collaborator Teammate
255,134,77 Tool 0 0 0 0 0 1
137,255,123 Machine 0 1 0 1 1 1
255,90,232 Subordinate 0 0 0 1 0 0
83,117,255 Colleague 0 0 0 0 0 0
106,255,240 Collaborator 0 0 0 0 2 1
210,215,250 Teammate 0 0 0 0 0 1<jupyter_text>Sequential Plot<jupyter_code>print("data data 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50") 
print("data data Tool Machine Subordinate Colleague Collaborator Teammate")


rowLabels = ['Tool','Machine','Subordinate','Colleague','Collaborator','Teammate']
colors = {
    0: '255,134,77',
    1: '137,255,123',
    2: '255,90,232',
    3: '83,117,255',
    4: '106,255,240',
    5: '210,215,250'
}

for i in range(0,6):
    s = "{} {}".format(colors[i], rowLabels[i])
    for j in range(0,6):
        s += " {}".format(int(sequentialResult[i,j]))
    print(s)<jupyter_output>data data 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50 50,50,50
data data Tool Machine Subordinate Colleague Collaborator Teammate
255,134,77 Tool 0 2 0 0 0 0
137,255,123 Machine 1 1 0 0 0 1
255,90,232 Subordinate 0 0 0 0 0 0
83,117,255 Colleague 0 0 0 0 0 0
106,255,240 Collaborator 0 0 0 0 1 0
210,215,250 Teammate 0 0 0 0 2 2
{'fraction_non_alphanumeric': 0.1559610097475631, 'fraction_numerical': 0.1564608847788053, 'mean_word_length': 3.4166666666666665, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 1, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '533910', 'license': 'MIT', 'n_tokens_mistral': 3931, 'n_tokens_neox': 2980, 'n_words': 843, 'path': 'analysis/Circos-Plots.ipynb', 'repo_name': 'Wisc-HCI/ITER', 'size': '8002'}