SHARE
TWEET

Untitled

a guest Jun 12th, 2019 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import psycopg2
  2. import numpy as np
  3. import pandas as pd
  4. from pandas import DataFrame
  5. import matplotlib.pyplot as plt
  6.  
  7. gp_conn = psycopg2.connect("dbname='gp_ns_ddl_prod' user='martin_ilavsky' password='' host='ddlpldurgpm11.us.dell.com' port='6420'")
  8. gp_cur = gp_conn.cursor()
  9.  
  10. sql = """
  11. SELECT
  12.    s.journey_stage_score
  13. FROM ws_mkt_dst.cjs_scores s
  14. WHERE run_uid = 86
  15.    and  s.journey_stage_score != 0
  16. """
  17.  
  18. gp_cur.execute(sql)
  19. #df = pd.DataFrame(gp_cur.fetchall(),columns=['parabolic','linear'],dtype='float')
  20. df = pd.DataFrame(gp_cur.fetchall(),columns=['parabolic'],dtype='float')
  21.  
  22.  
  23.  
  24.  
  25. df.info()
  26.  
  27.  
  28. #df.plot(kind='hist',logy='True',bins=30, title = 'Parabolic vs Linear')
  29. #df['parabolic'].plot(kind='hist',bins=40, title = 'Parabolic vs Linear')
  30. hist = df['parabolic'].hist(bins=300)
  31. # plt.axvline(x=0.039, color = 'orange')
  32. # plt.axvline(x=0.033, color = 'orange')
  33.  
  34.  
  35. plt.axvline(x=0.032, color = 'orange')
  36. plt.axvline(x=0.038, color = 'orange')
  37.  
  38. #df['linear'].plot(kind='hist',logy='True',bins=30, color='orange')
  39. #hist = df['parabolic'].hist(bins=100)
  40. #hist = df['linear'].hist(bins=100, color = 'orange')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top