Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- sql = """
- SELECT pclass, AVG(survived)
- FROM (SELECT t.pclass, s.survived
- FROM tripInfo t
- INNER JOIN survival s ON t.id = s.id
- ) AS x
- GROUP BY pclass
- """
- pd.read_sql(sql, con=connection)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement