Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.

Replace (Dictionary) operator has problem

kazemi_asgharkazemi_asghar Member Posts: 8 Learner I
hi.
i want to replace some codes whit cities name's.but i have a problem.
for example imagine this:
1----> A
2----> B
12----> C
but when i run my process instead of replacing "12" whit "C", it replaces "12" whit "AB"
I would appreciate it if help me.




Tagged:

Answers

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,531 RM Data Scientist
    Hi,
    I think you want to use the Map operator and not Replace? Replace is to be used with regular expressions.

    Best,
    Martin
    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • kazemi_asgharkazemi_asghar Member Posts: 8 Learner I
    @mschmitz i exactly want to use replace(dictionary) operator and it doesn't work properly.

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,531 RM Data Scientist
    Hi,
    okay, so you want to use regular expressions to replace parts of strings?
    ~Martin
    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • kazemi_asgharkazemi_asghar Member Posts: 8 Learner I
    i can't understand you but hear is my examples:
    1 آذربایجان شرقی


    2 آذربایجان غربی


    3 اردبیل


    4 اصفهان


    5 البرز


    6 ایلام


    7 بوشهر


    8 تهران


    9 جنوب کرمان(جیرفت و کهنوج)


    10 چهار محال و بختیاری


    11 خراسان جنوبی


    12 خراسان رضوی


    13 خراسان شمالی


    14 خوزستان


    15 زنجان


    16 مازندران(ساری)


    17 سمنان


    18 سیستان و بلوچستان


    19 فارس


    20 قزوین


    and i want to replace numbers whit city names in another attribute. so operator replace,for example, number 15 with combination of 1 and 5.
  • kaymankayman Member Posts: 662 Unicorn
    Replace your numbers as follows : \b1\b, so 12 becomes \b12\b

    This way the system knows it needs to replace the full number (12), and not 1 and 2 as that would be the default otherwise. 
Sign In or Register to comment.