blob: 6ac91cc5ad3809aaad614283a53dd6fbc43bfe52 [file] [log] [blame]
#!/usr/bin/env python3
from KorAPClient import KorAPClient, KorAPConnection
import plotly.express as px
QUERY = "Hello World"
YEARS = range(2010, 2019)
COUNTRIES = ["DE", "CH"]
kcon = KorAPConnection(verbose=True)
vcs = ["textType=/Zeit.*/ & pubPlaceKey=" + c + " & pubDate in " + str(y) for c in COUNTRIES for y in YEARS]
df = KorAPClient.ipm(kcon.frequencyQuery(QUERY, vcs))
print(df)
df['Year'] = [y for c in COUNTRIES for y in YEARS]
df['Country'] = [c for c in COUNTRIES for y in YEARS]
fig = px.line(df, title=QUERY, x="Year", y="ipm", color="Country",
error_y="conf.high", error_y_minus="conf.low")
fig.show()