import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
Author: Iza Romanowska
Date: 13/10/2020
Associated data: Dataset_concessions: Bobou, Olympia 2020. “Tomb concessions in Palmyra, Syria”, version 1.0. Zenodo. Doi: 10.5281/zenodo.4669962
Associated publications:
Bobou, O. et al. 2021 “Historical Trajectories of Palmyra’s elites through the lens of archaeological data.” Journal of Urban Archaeology 4: xxx.
Romanowska, I. et al. in press “Reconstructing the social, economic and demographic trends of Palmyra’s elite from funerary data.” Journal of Archaeological Science: xxx.
Raja, R. et al. 2021 “Three hundred years of Palmyrene history. Unlocking archaeological data for studying past societal transformations.” PloS One.
Description: Data analysis script visualising the phenomenon of concessions in Palmyra. Concession refers to a document granting legal rights to part of a tomb to another family. This data was collected by O. Bobou on the basis of the following publications:
Gawlikowski, M., 1970. Monuments funéraires de Palmyre, Travaux du Centre d’Archéologie Méditerranéenne de l’Académie Polonaise des Sciences. Editions scientifiques de Pologne, Warszawa. Higuchi, T. and K. Saito. 2001. Tomb F – Tomb of BWLH and BWRP – Southeast Necropolis, Palmyra, Syria, Publication of Research Center for Silk Roadology, 2 (Nara: Research Center for Silk Roadology).
df = pd.read_excel("SI_A_data/dataset_concessions.xlsx")
df.head()
dates_replace = {"130/131":"130", "142/143":"142", "238/239": "238", "178/179":"178", "225/226":"225", "240/214": "240", "249C": "249"}
# stripping ALL the text
df = df.replace([" CE", " CCE", "after ", "before ", "unknown"], "", regex = True)
df = df.replace(dates_replace)
df.iloc[7,:]= df.loc[7,:].str.split('/').str[0]
df.iloc[:, 1:] = df.iloc[:, 1:].apply(pd.to_numeric)
df
df.columns
palette = sns.color_palette('Blues_r',10 )
data = df.loc[:, df.columns.str.startswith('CD')]
data = data.T.apply(lambda x: x.dropna().tolist()).values
data = np.concatenate(data)
fig, ax = plt.subplots(2, 1, figsize = (10, 5), sharex = True, gridspec_kw={'height_ratios': [3, 1], 'hspace':0})
counter = 0
sns.distplot(data, bins = 10, ax = ax[0])
for i in df.loc[:, df.columns.str.startswith('CD')]:
sns.scatterplot( df[i], 1, ax = ax[1], label = i, marker = "s", color = palette[counter], s = 50)
counter += 1
plt.legend(loc='lower left', bbox_to_anchor=(0.88, 1.93))
plt.xlabel('Year (CE)')
ax[0].set_ylabel('PDF')
plt.yticks([], [])
plt.tight_layout()
plt.savefig('figures/Rom_Concessions', dpi = 600)
bins = range(0,350, 25)
#print(*bins)
fig, ax = plt.subplots(figsize = (15, 5))
ax = sns.distplot(data , kde = False, bins = bins, label = 'concession')
ax = sns.distplot(df["Foundation date"].values.tolist(), kde = False, bins = bins, label = 'foundation')
plt.legend()