Conversion to OxCal-compliant output

Archives des datations radiocarbone d'Afrique centrale


Dirk Seidensticker

see: https://c14.arch.ox.ac.uk/embed.php?File=oxcal.html


In [1]:
%matplotlib inline
from IPython.display import display
import pandas as pd

Conversion of the Data into OxCal-usable Form


In [6]:
df = pd.read_csv("https://raw.githubusercontent.com/dirkseidensticker/aDRAC/master/data/aDRAC.csv", encoding='utf8')
display(df.head())


LABNR C14AGE C14STD C13 MATERIAL SITE COUNTRY FEATURE FEATURE_DESC LAT LONG SOURCE
0 AA-78447 2362 39 0.0 NaN Mbaere CAF NaN Pollencore 3.988639 16.924447 Kiahtipes/Lupo et al. 2011
1 AA-78448 2171 37 0.0 NaN Mbaere CAF NaN Pollencore 3.988639 16.924447 Kiahtipes/Lupo et al. 2011
2 AA-78449 834 35 0.0 NaN Mbaere CAF NaN Pollencore 3.988639 16.924447 Kiahtipes/Lupo et al. 2011
3 Arc-339 2310 60 0.0 Charcoal Mont Brazza GAB NaN NaN NaN NaN Clist 2004/05
4 Arc-340 540 50 0.0 NaN Mont Barnier COG NaN NaN -4.186390 15.200280 Pincon 1991

Choosing only the first five entries as subsample:


In [3]:
df_sub = df.head()


Out[3]:
LABNR C14AGE C14STD C13 MATERIAL SITE COUNTRY FEATURE FEATURE_DESC LAT LONG SOURCE
546 GrN-13077 440 50 0.0 Charcoal Bamanya COD BAM 81/1 NaN 0.00979 18.316297 Wotzka 1995: 138
645 Hv-11570 2245 195 0.0 Charcoal Bamanya COD BAM 81/1 NaN 0.00979 18.316297 Wotzka 1995
656 Hv-12203 65 50 0.0 Charcoal Bamanya COD BAM 81/1 NaN 0.00979 18.316297 Wotzka 1995
665 Hv-12615 2210 180 0.0 Charcoal Bamanya COD BAM 83/2 NaN 0.00979 18.316297 Wotzka 1995
666 Hv-12616 5245 695 0.0 Charcoal Bamanya COD BAM 83/2 NaN 0.00979 18.316297 Wotzka 1995
667 Hv-12617 1955 115 0.0 Charcoal Bamanya COD BAM 83/2 NaN 0.00979 18.316297 Wotzka 1995
670 Hv-12620 945 75 0.0 Charcoal Bamanya COD BAM 83/1 NaN 0.00979 18.316297 Wotzka 1995: 138
671 Hv-12621 1170 120 0.0 Charcoal Bamanya COD BAM 83/1 NaN 0.00979 18.316297 Wotzka 1995
749 KI-2360 420 65 -29.1 Charcoal Bamanya COD BAM 83/1 NaN 0.00979 18.316297 Wotzka 1995: 138
750 KI-2361 640 70 -25.3 Charcoal Bamanya COD BAM 83/1 NaN 0.00979 18.316297 Wotzka 1995: 138

OxCal-compliant output:


In [5]:
print('''Plot()
{''')
for index, row in df_sub.iterrows():
    print('R_Date("', row['SITE'],'/', row['FEATURE'], '-', row['LABNR'],'",', row['C14AGE'],',', row['C14STD'],');')
print('};')


Plot()
{
R_Date(" Bamanya / BAM 81/1 - GrN-13077 ", 440 , 50 );
R_Date(" Bamanya / BAM 81/1 - Hv-11570 ", 2245 , 195 );
R_Date(" Bamanya / BAM 81/1 - Hv-12203 ", 65 , 50 );
R_Date(" Bamanya / BAM 83/2 - Hv-12615 ", 2210 , 180 );
R_Date(" Bamanya / BAM 83/2 - Hv-12616 ", 5245 , 695 );
R_Date(" Bamanya / BAM 83/2 - Hv-12617 ", 1955 , 115 );
R_Date(" Bamanya / BAM 83/1 - Hv-12620 ", 945 , 75 );
R_Date(" Bamanya / BAM 83/1 - Hv-12621 ", 1170 , 120 );
R_Date(" Bamanya / BAM 83/1 - KI-2360 ", 420 , 65 );
R_Date(" Bamanya / BAM 83/1 - KI-2361 ", 640 , 70 );
};

In [ ]: