In [14]:
import pandas as pd
import numpy as np
import plotly.plotly as py
import plotly.graph_objs as go
df = pd.read_csv("https://raw.githubusercontent.com/democratia/political_science/master/Daten/ch-obligationen-zins.csv", sep=",")
zeitraum = list(df)[1:]
print(zeitraum)
In [15]:
traces = []
for i in zeitraum:
print(i)
traces.append(go.Scatter(
x=df["Monat"],
y=df[i],
mode='lines',
connectgaps=True,
name=i
))
layout = go.Layout(
title='Entwicklung Zinsen für Obligationen der Eidgenossenschaft',
xaxis=dict(title='Monat'),
yaxis=dict(title='Zins')
)
fig = go.Figure(data=traces, layout=layout)
py.iplot(fig, filename='ch-obligation-zinsen')
Out[15]:
In [ ]: