Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. import pandas as pd
  2.  
  3. sql = """
  4. SELECT pclass, AVG(survived)
  5. FROM (SELECT t.pclass, s.survived
  6. FROM tripInfo t
  7. INNER JOIN survival s ON t.id = s.id
  8. ) AS x
  9. GROUP BY pclass
  10. """
  11.  
  12. pd.read_sql(sql, con=connection)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement