Prepare your data – wrangling

Data science in progress. Right now reading and applying rules from lesson no 2: Data preparation, so called data munching. This is not something you want to do as a data scientist, it’s just indispensable to prepare your data for later processing. As Nick says:

More than 50 percent of time is just coming through the data and guessing is it OK – Nick

What can you learn in lessons from Data Wrangling section.


First I was reminded about common data formats.  CSV, XML, JSON – these 3 are most popular in data world.  Thankfully Pandas offers good way of consuming and producing these formats.

SQL found here

It was brand new for me that after forming dataframe I can play with it as with the SQL table using pandasql library.  Udacity course shows potential of these SQL extensions in Aadhaar dataset containg our dear registered friends from India.  Using pandasql I can query dataset using SQL-92 syntax freely, including filtering (where) and grouping (group by).

call APIs

To process data you have to get it first.  Sometimes it can be available on some endpoint.  In Python you can easily call APIs using requests. It is as easy as

so you can easily get all info from any available endpoint and parse JSON response easily. It was an example to use that when querying against OpenFM API .

I miss you, value!

Missing values is another challenge you will find here, when dealing with data preparation.  Usually in pythonic way such values are None’s in dataframe.  What then?  We can impute, or guess what to do.  In baseball dataset I was encourage to use mean value as imputation. But better think twice! Imputation can lead to unclear conclusions.  Here it was done using numpy‚s mean function.