
This means that dates with no sales aren’t in the database. The database only records transactions that have occurred (it seems obvious when said like that!). This may seem like the sort of query we’ve already looked at, however there is a catch. Which days of March 2007 recorded no sale? We start by loading the Python required libraries (we’ll do all our data wrangling using the awesome pandas module) and create a connection to the PostgreSQL database using sqlalchemy.įor our examples we’ll be using the well-known dvdrental database which contains 15 tables representing various aspects of a DVD rental business. Our SQL examples are based on some of the contents of that course.

One of my personal favourites is SQL Fundamentals for BI by Jeffrey James. For SQL there are more resources than we can mention, especially once we factor in the various vendor-specific flavours of SQL. For R it’s hard to get past the wonderful R for Data Science by Garrett Grolemund and Hadley Wickham. There are many excellent resources online.įor data wrangling the Python Data Science Handbook is an outstanding book. We won’t be covering the basics of each language in this post.
SOUND NORMALIZER 7.99.7 CODE
We’ll run an IPython kernel as our base platform and use an IPython magic command to run our R code within the same environment, and we’ll use sqlalchemy to run queries on a postgreSQL data base. The Jupyter notebook allows us to run all our examples in one place. However, we’re mostly interested in illustrating some basic data wrangling pipelines in all three languages, so we’ll be using a small database that can easily fit in memory. Both Python and R can process data in chunks, or even work with huge, distributed data sets through libraries like Dask (Python only) or Apache Spark (Python, R, Scala, Java). Note that while Python and R have obvious similarities in their approach to data wrangling, SQL is designed to work with relational data, where most of the time consuming operations are (ideally) performed on the database side rather than In this post we will look a how basic data wrangling operations can be performed in 3 languages
