aboutsummaryrefslogtreecommitdiffstats
path: root/python/exploration/test_mlp.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/exploration/test_mlp.py')
-rw-r--r--python/exploration/test_mlp.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/python/exploration/test_mlp.py b/python/exploration/test_mlp.py
new file mode 100644
index 00000000..15b6b72d
--- /dev/null
+++ b/python/exploration/test_mlp.py
@@ -0,0 +1,21 @@
+import pandas as pd
+from sqlalchemy import create_engine
+from sqlalchemy.engine.url import URL
+
+
+def get_conn():
+ uri = URL(
+ drivername="postgresql", host="ziggy", username="mlp_user", database="mlp_scd"
+ )
+ return create_engine(uri, paramstyle="format")
+
+
+engine = get_conn()
+df = pd.read_sql(
+ "SELECT * FROM quote JOIN basket ON "
+ "securityid=basketid WHERE basketfamily='CDX' AND basketsector='IG' "
+ "AND basketseries=8 AND tenor='Y5' AND basketsubsector='*' "
+ "and quotesource='M' order by quotedate",
+ engine,
+)
+df.set_index("quotedate").plot()