Split and rename columns

jasonsnare
jasonsnare Registered Posts: 4 ✭✭✭

Hello!

I have one dataset and I want to split all the columns values (Starting from the column "180 COOL", using || delimiter) and then rename it like attached example. Please let me know if anyone has python code to do this process.

In the provided example screenshot need to split 4 columns. the real dataset contains 7000 columns split and rename.


Answers

  • Catalina
    Catalina Dataiker, Dataiku DSS Core Designer, Registered Posts: 135 Dataiker

    Hi @jasonsnare
    ,

    You can get the desired output without using Python code.

    You can use a Prepare recipe with below steps:

    - use split function and delimiter "||" in order to split the original column by delimiter and create two separate columns

    Screenshot 2023-04-11 at 19.17.27.png

    - remove the original columns

    Screenshot 2023-04-11 at 19.21.36.png

    - rename the columns name

    Screenshot 2023-04-11 at 19.20.10.png

Setup Info
    Tags
      Help me…