Skip to content

Instantly share code, notes, and snippets.

@austinogilvie
Last active December 14, 2015 03:29
Show Gist options
  • Select an option

  • Save austinogilvie/5021628 to your computer and use it in GitHub Desktop.

Select an option

Save austinogilvie/5021628 to your computer and use it in GitHub Desktop.
# joining meats + births on date
q = """
SELECT
m.date
, b.births
, m.beef
FROM
meat m
INNER JOIN
births b
on m.date = b.date
ORDER BY
m.date
LIMIT 100;
"""
joined = pysqldf(q)
print joined.head()
# date births beef
# date
# 1975-01-01 00:00:00 1975-01-01 00:00:00 0.009302 0.010676
# 1975-02-01 00:00:00 1975-02-01 00:00:00 0.008437 0.009353
# 1975-03-01 00:00:00 1975-03-01 00:00:00 0.009410 0.009586
# 1975-04-01 00:00:00 1975-04-01 00:00:00 0.008661 0.009607
# 1975-05-01 00:00:00 1975-05-01 00:00:00 0.008909 0.009373
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment