Let's compare data prepping in Alteryx and Python.

We'll start with Alteryx in this Blogpost and continue with Python next time.


The Challenge

As an example we will use a simplified version of this data prep challenge:

Our Data lies in two .csv files:

pkmn_evolutions.csv
pkmn_stats.csv

The last three columns can be ommited, as they are not used in this solution.

Also Pokemon without a second and third stage shall be filtered out.

Our goal is to calculate a combat_score for every pokemon by summing all columns from hp to speed and add the values of the first and last stage as columns to the pkm_evolutions.csv table. Then add a column pwr_increase which shows the relative increase in power between first and last stage.


The Alteryx Solution

Alteryx Workflow

My Solution in Alteryx has roughly four segments:

  • Transpose the columns relevant for combat_power and sum those values using group by name:
  • successively join by name and stage 1-3 ("name"="stage_X"):
  • union results with two stages and with three stages together:
  • calculate first and last combat_pwr aswell as combat_pwr_increase:

And done. Now the resulting table matches our goal!

Up next: creating the same table from the same data, but in Python.