In [37]:
%matplotlib inline
from IPython.display import display
import pandas as pd
import sqlite3
con = sqlite3.connect("../../../Dissertation/data/CongoDB.sqlite")
Retriev entries from the DB that originate from public available sources:
In [38]:
sql = """SELECT
t_14C.LABNR,
t_14C.C14AGE,
t_14C.C14STD,
t_14C.C13,
t_14C.MATERIAL,
't_Ort'.'ort_name' AS SITE,
t_Ort.ort_land AS COUNTRY,
't_ort'.'ort_kurz' || ' ' || 't_komplex'.'bef_nr' AS FEATURE,
t_komplex.feature_type AS FEATURE_DESC,
t_Ort.y_lat AS LAT,
t_Ort.x_long AS LONG,
t_14C.Lit AS SOURCE
FROM (t_Ort INNER JOIN t_Komplex ON t_Ort.ortID = t_Komplex.ortID)
INNER JOIN t_14c ON t_Komplex.komplexID = t_14c.komplexID
WHERE (((t_14C.Lit) Not Like '%Ordner%')
AND ((t_14C.Lit) != ''))""".replace('\n',' ')
df = pd.read_sql(sql, con)
len(df)
Out[38]:
Review the top of the Dataset:
In [39]:
display(df.head())
Save table to CSV-Format:
In [40]:
df.to_csv("../data/aDRAC.csv", index=False, encoding='utf8')
In [ ]: