🥳 RAPIDMINER 9.9 IS OUT!!! 🥳

The updates in 9.9 power advanced use cases and offer productivity enhancements for users who prefer to code.

CLICK HERE TO DOWNLOAD

How can I change the name of columns

Loan_Nguyen56Loan_Nguyen56 Member Posts: 5 Contributor I
Hello All,

I would like to change the three last column's names into "First Class", "Second Class", and "Third Class" instead of "Passenger First Class"... as well.

Thank you very much.
Loan Nguyen

Best Answer

  • ceaperezceaperez Member Posts: 116   Unicorn
    Solution Accepted
    Hi @Loan_Nguyen56
    You have an operator named Rename into Blending-> Attributes->Names & Roles.

    regards



Answers

  • Loan_Nguyen56Loan_Nguyen56 Member Posts: 5 Contributor I
    edited April 4
    ceaperez 
    Thanks for your letting me know. 
    Besides that, I follow the instructions below to get the new column names however, I cannot get the right answer. 
    "Renaming attributes with regular expressions
    1. Search for the operator Rename by Replacing, add it, and connect it to Pivot.
    2. Also connect the operator to the result port on the right.
    3. Copy count\((.*)\)_(.*) into the replace what parameter field. Make sure that you get all the parentheses right!
    4. Copy $1 $2 into the replace by parameter. "
    And, what does count\((.*)\)_(.*)  means?

    Thanks,

  • ceaperezceaperez Member Posts: 116   Unicorn
    Hi @Loan_Nguyen56

    They are replacing the names of the Attributes (Column) using a Regular Expression.
    Probably their Attributes names are like count(something)_anotherthing
    With this part count\((.*)\)_(.*) they are locating the two parametrized blocks after the string "count"
    Then with  $1 $2 instruction into the replace by parameter, they are replacing the original string by the first coincident block $1 (something) and the second coincidente block $2 (anotherthing)

    you don't have a regular pattern  in your Attributes names maybe is better to use another operator like Rename by Generic Name and write Passenger Class, for example. 

    Regards, 
    Loan_Nguyen56
  • Loan_Nguyen56Loan_Nguyen56 Member Posts: 5 Contributor I
    ceaperez,

    Wow, I understand it clearly.
    Thank you very much for your kind help.

    Regards,


Sign In or Register to comment.