Skip to main content

Hi there,

I have some data where one column is only sparsely filled, and I want to fill these missing ones based on another present attribute. Here's a basic representation:

ClassTypeMammalDog

 

DogFishTrout

 

Trout

 

TroutReptileLizard

 

Lizard

 

What I need to do is fill in all the empty "Class" lines based on the "Type". In the data, each Type will always have at least one entry in Class (aka, no Type will ever be classless), and no Type will have more than one class.

So in short, my current data may have 3 entries with "Trout" and only one of those specify the class as "Fish". What I want is to derive the info from that one Type entry, and fill in all the blank Class lines.

 

Thanks in advance for any tips!

 

Best regards,

If you sort your data by Type, you can use the adjacent Attribute Handling in the attributecreator to fill in the blanks in class by using the preceding feature value.

You could also test for the non blank values and then featuremerge them back to the original data


If you sort your data by Type, you can use the adjacent Attribute Handling in the attributecreator to fill in the blanks in class by using the preceding feature value.

You could also test for the non blank values and then featuremerge them back to the original data

Hi @egomm,

There's a lot of other attribute values present as well, so I'm a little scared of splitting and re-merging, as I'm cautious to not suffer any data-loss.

As for the first option you mentioned, I had a quick look but quite frankly, I have no idea of how this functionality works, as I've never before used it. I checked the help page but it is still a bit blurry. Any tips on how I should fill it in to make use of the Adjacent feature functionality?

 

Thanks!


Hi @egomm,

There's a lot of other attribute values present as well, so I'm a little scared of splitting and re-merging, as I'm cautious to not suffer any data-loss.

As for the first option you mentioned, I had a quick look but quite frankly, I have no idea of how this functionality works, as I've never before used it. I checked the help page but it is still a bit blurry. Any tips on how I should fill it in to make use of the Adjacent feature functionality?

 

Thanks!

Can you see the image I posted? (I edited to add it after I first posted so you might have missed it, or the forum gremlins might mean it doesn't appear)


If you sort your data by Type, you can use the adjacent Attribute Handling in the attributecreator to fill in the blanks in class by using the preceding feature value.

You could also test for the non blank values and then featuremerge them back to the original data

Hi @egomm,

 

This work perfectly thanks. The picture popped up afterward and I followed it exactly.

 

Best regards,


Hi

 

As long as there is always a Class value first before any blanks then this can be done within a python caller as attached

 

You will get a nice error message if this is not the case!

Cheers

Dave

 

Filling in blank attributes.fmw


Reply