# Initialize plotlyimport plotlyplotly.offline.init_notebook_mode(connected =False);# Read in the Fieldmark and its associated dataframe and match dictionaryfrom fieldmark_khipu_summary import FieldmarkTopCordsaFieldmark = FieldmarkTopCords()raw_match_dict = aFieldmark.raw_match_dict()print(f"# of Matching Khipus = {len(aFieldmark.matching_khipus())}")
# of Matching Khipus = 31
Code
from plotly import express as pximport pandas as pd# Plot Significant khipusignificant_khipus = aFieldmark.matching_khipus()significant_values = [raw_match_dict[aKhipuName] for aKhipuName in significant_khipus]significant_df = pd.DataFrame(list(zip(significant_khipus, significant_values)), columns =['KhipuName', 'Value'])fig = px.bar(significant_df, x='KhipuName', y='Value', labels={"KhipuName": "Khipu Name", "Value": "Number of Top Cords", }, title=f"Significant Khipu ({len(significant_khipus)}) for Number of Top Cords", width=944, height=450).update_layout(showlegend=True).show()
Top cords are a rare phenomenon, with the exception of outlier UR006! They only exist in 07% of the khipus in the KFG database.
Top cords function in many ways. The most famous, as discovered by Locke, are sum cords - where the cord value equals the sum of the cords of an adjacent group. Some top cords are double the sum of cords of an adjacent group. Some are counts of cords between them and another marker of some sort.
Manuel Medrano has observed that Top cords associate with Banded groups. Let’s graph that: The KFG database uses a very simple heuristic for banded groups - one color in the entire set of cords:
Let’s make a dataframe of topcord khipus with topcord count, banded group count, and seriated group count.
Code
%%capture import qollqa_chuspa as qcimport utils_khipu as ukhipuimport utils_loom as uloom(khipu_dict, all_khipus) = qc.fetch_khipus()# Make a dataframe of topcord khipus with topcord count, banded group count, and seriated group count.topcord_khipus = [khipu_dict[khipu_name] for khipu_name in significant_khipus]def topcord_record(aKhipu): is_banded = aKhipu.num_banded_groups() > aKhipu.num_seriated_groups()return (aKhipu.kfg_name(), aKhipu.num_top_cords(), aKhipu.num_banded_groups(), aKhipu.num_seriated_groups(), is_banded)topcord_data = [topcord_record(aKhipu) for aKhipu in topcord_khipus]topcord_df = pd.DataFrame(topcord_data, columns=["kfg_name", "num_top_cords", "num_banded_groups", "num_seriated_groups", "is_banded"])from pandas2html import Pandas2HTMLdef make_dataframe_viewer():class TopCordsViewer(Pandas2HTML):def__init__(self, file_specs, page_specs, column_specs, from_df=None):super().__init__(file_specs, page_specs, column_specs, from_df=from_df)def columns_to_display(self):return ['kfg_name', 'num_top_cords', 'num_banded_groups', 'num_seriated_groups', 'is_banded'] file_specs = {"template_file":f"{uloom.project_directory()}/templates/dataframe_viewer.html","output_dir":f"{ukhipu.fieldmark_www_directory()}/analyses/database","basename":"num_banded_vs_seriated_top_cords", } page_specs = {"title":"# of Top Cords by Banded vs Seriated Groups","description":"# of Top Cordsby Banded vs Seriated Groups","logo_link":ukhipu.kfg_domain_url(), } column_specs = {'kfg_name': {'label':"KFG Name",'formatter':"kfg_name",'header_class_name':"th_kfg_name",'header_class_style':"align:right;width:80px;",'row_class_name':"td_kfg_name",'row_class_style':"align:right;width:80px;", },'num_top_cords':{'label':"# Top Cords", 'formatter':"number",'header_class_name':"th_num_top_cords",'header_class_style':"align:center;width:109px;min-width:109px;max-width:109px;",'row_class_name':"td_num_top_cords",'row_class_style':"align:center;width:109px;min-width:109px;max-width:109px;", },'num_banded_groups': {'label':"# Banded Groups", 'formatter':"number",'header_class_name':"th_num_banded_groups",'header_class_style':"align:center;width:109px;min-width:109px;max-width:109px;",'row_class_name':"td_num_top_cords",'row_class_style':"align:center;width:109px;min-width:109px;max-width:109px;", },'num_seriated_groups':{'label':"# Seriated Groups", 'formatter':"number",'header_class_name':"th_num_seriated_groups",'header_class_style':"align:center;width:109px;min-width:109px;max-width:109px;",'row_class_name':"td_num_seriated_groups",'row_class_style':"align:center;width:109px;min-width:109px;max-width:109px;", },'is_banded':{'label':"Is Banded?", 'formatter':"boolean",'header_class_name':"th_is_banded",'header_class_style':"align:center;width:109px;min-width:109px;max-width:109px;",'row_class_name':"td_is_banded",'row_class_style':"align:center;width:109px;min-width:109px;max-width:109px;", } } TopCordsViewer(file_specs, page_specs, column_specs, from_df=topcord_df).make_pandas_html()make_dataframe_viewer();
def banded_color(x): return0.0if x else1.0topcord_df['banded_color'] = [banded_color(x) for x in topcord_df.is_banded.values]legend_text ="<i style=\"font-size:10pt;\"> Size:Num Top Cords, Blue:Banded, Red:Seriated</i>"fig = (px.scatter(topcord_df, x="num_seriated_groups", y="num_banded_groups", size="num_top_cords", color='banded_color', color_continuous_scale=['#3c3fff', '#ff3030',], labels={"num_banded_groups": f"# Banded Groups", "num_seriated_groups": "# Seriated Groups", }, hover_data=['kfg_name'], title=f"<b>Top Cords - Banded vs Seriated Groups</b>{legend_text}", width=944, height=944) .update_layout(showlegend=False).update(layout_coloraxis_showscale=False).show() )
5. Conclusion
On its own, the above graph is not conclusive , but it does appear that khipus with top cords tend towards having predominantly banded groups. However, when we examine the database generated above, and view at the drawings of the actual seriated top cord khipus, we see that these khipus have
Top cords that are probably not top cords (i.e AS212 with 12 seriated groups and one banded group), or
Banded groups adjacent to top cords on the right half (QU015, QU009, etc. - many of Kylie Quave’s khipus are “joined” khipus…)
Viewing these individual exceptions shows that Manny’s thesis likely hold true!