How replace missing values with average 0 decimals after the comma (for example: 8 in stead of 8.23)

haasder
haasder New Altair Community Member
edited November 2024 in Community Q&A
I have some missing ages in my dataset. I want to replace them with averages with zero decimals after the comma, so with no commas. Can someone help me?

Answers

  • David_A
    David_A New Altair Community Member
    Hi,

    you can use the Generate Attributes operator to round the numbers (function round(), ceil() or floor()).
    If you only want to round the replaced values. I would generate a temporary flag attribute before the replacement (if(missing(att1), 1,0) ) and then later only apply the rounding to those examples, were the flag is true:
    if(flag=TRUE, round(att1), att1)

    Best,
    David
  • Telcontar120
    Telcontar120 New Altair Community Member
    You can also use Format Numbers and then specify whatever pattern you want.