Generating attributes based on the values of another attribute

sectyn
sectyn New Altair Community Member
edited November 2024 in Community Q&A
I have a nominal attribute and would like to generate an attribute with each value of the initial nominal attribute as a new attribute name. For each occurrence of any given value in the nominal attribute, I would also like to increment the value in the corresponding attribute by 1. Initial approach was to try Loop Values, but Loop Values skips that particular Loop if the attribute has already been created. Any thoughts on a different approach to this problem? Thanks!
Tagged:

Answers

  • lionelderkrikor
    lionelderkrikor New Altair Community Member
    Hi @jennyclub,

    I have difficulties to understand what you want to achieve.
    Can you give an example of what you initially have AND an example of what you want to get.

    Regards,

    Lionel
  • sectyn
    sectyn New Altair Community Member
    I am attaching the process on the Titanic dataset which I have done so far. I have generated 3 new attributes based on the values in the Port of Embarkation attribute. The output of this process almost achieves what I want. The only thing is for passengers 'Connolly, Miss. Kate' and 'Kelly, Mr. James', instead of 2 entries in the final result it should only give one entry with corresponding attributes updated.
    I am also sure there is a much better way or some operator which elegantly achieves this without going through the lengthy process I have done.

  • sectyn
    sectyn New Altair Community Member
    Ok...I have made a little more progress on the problem and have attached the new process. The output of this process are two example sets. I want to look at the smaller example set and increment the values in the bigger example set accordingly.