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
Loop Attributes Not Working for Attribute Name Containing Space
Hi RM and Community - working in Studio 9.0.001 and trying to utilize Loop Attributes to convert several attributes from Nominal to Date.
I experienced the error "Error evaluating expression: the function 'eval' failed to parse the subexpression 'Bus Unit'. Cause: extraneous input Unit expecting operator."
My process utilizes Loop Attributes over a subset. Inside the loop there is a "Generate Attributes" operator attempting to generate "%{loop_attribute}_new" via an expression to convert the string to a Date. I have selected a single attribute "Bus Unit" to identify the issue but my use case is to select several.
I have found when I loop an Attribute with a space in the name - "Bus Unit" in this case - the exception is thrown. When I choose a single attribute of either poly/nominal or real type and the name does NOT contain a space, the loop attributes works wonderfully as expected.
I think this is a bug - can I get some feedback/assistance? I will attempt to utilize the "rename by replacing" operator to see if this helps. However I wouldn't expect spaces in the Attribute name to be a nuisance to RM.
I experienced the error "Error evaluating expression: the function 'eval' failed to parse the subexpression 'Bus Unit'. Cause: extraneous input Unit expecting operator."
My process utilizes Loop Attributes over a subset. Inside the loop there is a "Generate Attributes" operator attempting to generate "%{loop_attribute}_new" via an expression to convert the string to a Date. I have selected a single attribute "Bus Unit" to identify the issue but my use case is to select several.
I have found when I loop an Attribute with a space in the name - "Bus Unit" in this case - the exception is thrown. When I choose a single attribute of either poly/nominal or real type and the name does NOT contain a space, the loop attributes works wonderfully as expected.
I think this is a bug - can I get some feedback/assistance? I will attempt to utilize the "rename by replacing" operator to see if this helps. However I wouldn't expect spaces in the Attribute name to be a nuisance to RM.
Tagged:
0
Best Answer
-
Telcontar120 RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 UnicornSpaces in attribute names are definitely a nuisance inside the expression editor. That's why in the current expression editor, attribute names with spaces are enclosed within square brackets. You could try doing the same thing with your macro, but probably the best solution is to strip out the whitespaces altogether with the Rename by Replacing operator.
5
Answers
i think you need to use
#{loop_attribute}_new
but i am confusing myself here all the time as well. @David_A is the local expression parser ninja.
BR,
Martin
Dortmund, Germany
This error is so frustrating! Why would "Stnd_Hrs_Wk" not be a valid attribute name to include in a Loop Attributes??!
Lindon Ventures
Data Science Consulting from Certified RapidMiner Experts