How to stack multiple datasets using python

Options
PhilippeDulac
PhilippeDulac Registered Posts: 11 ✭✭✭

Hi,

I need a python script to select my input datasets that I want to stack (I want to stack the same way the stack recipe would do it).
Is there an easy way to stack my dataset once selected in my script. I wouldn't like to do it row by row !

Thanks in advance for your help,

Philippe

Answers

  • HarizoR
    HarizoR Dataiker, Alpha Tester, Registered Posts: 138 Dataiker
    Options

    Hi Philippe,

    Your Python recipe can take as many input datasets as you want, each of them yields a Pandas DataFrame that you can manipulate in your code. If you want to stack them, you can use the `pandas.concat` method.

    Out of curiosity, what did you find missing in the stack recipe to fall back to a code recipe ?

    Best,

    Harizo

  • PhilippeDulac
    PhilippeDulac Registered Posts: 11 ✭✭✭
    Options

    Hi Harizo,

    Thanks for this quick answer. I'll try panda concat and accept the solution

    Stack recipe is perfect for most purpose but it have to be linked to "unvariable" input datasets.

    With python I'm able to choose my input dataset which are not the same each month ...

    Best regards,

    Philippe

Setup Info
    Tags
      Help me…