๐งญ Chapter 1.6 Tutorial: Excavation Insights at Tell Logika
Scenario:
You are part of the digital archaeology team working at the site of Tell Logika. Over the past season, you’ve collected data from multiple trenches on the percentage of metal tools found, the elevation of each trench, and the number of artifacts recovered.
Your goal is to clean, structure, analyze, and visualize this dataset to support a preliminary field report. Your team is particularly interested in identifying trenches that show early adoption of metal tools and whether elevation appears related to this pattern.
๐ Setup Instructions
- Open Jupyter Notebook
- Navigate to:
ComputationalArchaeology/chapter1
- Create a new notebook:
TellLogika_Tutorial_Summary.ipynb
๐งช Step-by-Step Instructions
โ Step 1: Create a Structured Dataset
import pandas as pd
# Mock excavation dataset
data = {
"Trench": ["TL01", "TL02", "TL03", "TL04", "TL05"],
"Elevation_m": [150, 160, 200, 140, 175],
"%Metal_Tools": [40, 75, 85, 20, 95],
"Total_Artifacts": [120, 85, 100, 70, 140]
}
df = pd.DataFrame(data)
df
Tip: Add new trenches to test how your analysis scales.
โ Step 2: Filter High Metal Tool Trenches
# Filter for trenches with >50% metal tools
high_metal = df[df["%Metal_Tools"] > 50]
high_metal
Try This: Change the threshold to 70% and observe the difference.
โ Step 3: Create a Set and Explore Cardinality
high_set = set(high_metal["Trench"])
print("High Metal Trenches:", high_set)
print("Cardinality:", len(high_set))
Why: Sets help you identify unique qualifying trenches and compare groups.
โ Step 4: Build a Lookup Dictionary
elevation_dict = dict(zip(df["Trench"], df["Elevation_m"]))
print(elevation_dict)
Try This: Access the elevation of a trench directly using its ID.
โ Step 5: Create a Bar Chart โ Metal Tool Use
import matplotlib.pyplot as plt
plt.bar(df["Trench"], df["%Metal_Tools"], color="steelblue")
plt.title("Metal Tool Use by Trench")
plt.xlabel("Trench")
plt.ylabel("% Metal Tools")
plt.grid(True)
plt.show()
Try This: Change bar color or reorder the trenches.
โ Step 6: Create a Scatterplot โ Elevation vs Metal Use
plt.scatter(df["Elevation_m"], df["%Metal_Tools"], color="darkred")
for i in range(len(df)):
plt.text(df["Elevation_m"][i], df["%Metal_Tools"][i], df["Trench"][i])
plt.title("Elevation vs Metal Tool Use")
plt.xlabel("Elevation (m)")
plt.ylabel("% Metal Tools")
plt.grid(True)
plt.show()
Challenge: Flip the axes and visualize metal use on the X-axis.
โ Step 7: Save a Filtered Subset
filtered = df[df["%Metal_Tools"] > 60]
filtered.to_csv("logika_high_metal_trenches.csv", index=False)
This file will appear in your Week1 folder โ share it with your supervisor!
๐ง Reflection Questions
- Which trenches had the highest proportion of metal tools?
- Is there any visible relationship between elevation and metal use?
- How could you extend this analysis with material type (stone, wood, metal)?
- How did using sets and dictionaries help you organize or access the data?
๐ What You’ve Learned (Chapters 1.1โ1.4)
- โ How to define and apply sets, relations, and functions
- โ How to structure and filter archaeological data using lists, tuples, and dictionaries
- โ How to read and clean CSV/JSON files
- โ How to create and customize bar charts and scatterplots
- โ How to summarize and export subsets of data for reporting
Youโve now built a complete workflow โ from raw data to analysis and visualization. In the next section, youโll test your understanding with a short quiz.