The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

How do i aggregate per Attribute where value of row is 1?

MilosssMilosss Member Posts: 1 Learner I
Hello all together!
I got a csv file which contains this:

i need to count the number of 1 per attribute. I had an Idea to first filter for every attribute = 1 and then to aggregate each attribute with count, but with 110 attributes this could take a while. 
Does anybody have an Idea how to speed up this process? 

Answers

  • jacobcybulskijacobcybulski Member, University Professor Posts: 391 Unicorn
    I assume you need to create sums of all (great many) attributes (which happen to be 0 or 1). One way can be to use a Loop Attributes operator, which is able to perform operations on all selected attributes. Within the looping operator place the Aggregate but for the aggregation attribute enter %{loop_attribute} and a sum, which will be replaced by the attribute name, loop goes through. The Loop Attributes then produces a large number of separate example sets of one attribute each. These can be merged into a single example set using Merge Attributes from the Operator Toolbox extension. If you need to select only certain types of attributes for this processing, or to exclude a few, this can be done at the Loop Attributes operator and its attribute filter, to include or exclude special attributes, etc.
Sign In or Register to comment.