Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import psycopg2
- import numpy as np
- import pandas as pd
- from pandas import DataFrame
- import matplotlib.pyplot as plt
- gp_conn = psycopg2.connect("dbname='gp_ns_ddl_prod' user='martin_ilavsky' password='' host='ddlpldurgpm11.us.dell.com' port='6420'")
- gp_cur = gp_conn.cursor()
- sql = """
- SELECT
- s.journey_stage_score
- FROM ws_mkt_dst.cjs_scores s
- WHERE run_uid = 86
- and s.journey_stage_score != 0
- """
- gp_cur.execute(sql)
- #df = pd.DataFrame(gp_cur.fetchall(),columns=['parabolic','linear'],dtype='float')
- df = pd.DataFrame(gp_cur.fetchall(),columns=['parabolic'],dtype='float')
- df.info()
- #df.plot(kind='hist',logy='True',bins=30, title = 'Parabolic vs Linear')
- #df['parabolic'].plot(kind='hist',bins=40, title = 'Parabolic vs Linear')
- hist = df['parabolic'].hist(bins=300)
- # plt.axvline(x=0.039, color = 'orange')
- # plt.axvline(x=0.033, color = 'orange')
- plt.axvline(x=0.032, color = 'orange')
- plt.axvline(x=0.038, color = 'orange')
- #df['linear'].plot(kind='hist',logy='True',bins=30, color='orange')
- #hist = df['parabolic'].hist(bins=100)
- #hist = df['linear'].hist(bins=100, color = 'orange')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement