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
Reading csv files with % and $ data
I am trying to read a csv file. The column names and first row of data are below. I need to convert data that contain % or $ to real numbers, not polynomials. How can I do this?
"id";"rank";"name";"employees";"previous";"revenues";"revenuechange";"profits";"profitschange";"assets";"marketvalue"
"2";"1";"Walmart";"2,300,000";"1";"$485,873";"0.8%";"$13,643.0 ";"-7.2%";"$198,825";"$218,619"
I am sure there is an easy way to do this, but I can't find it. Thanks in advance.
Tagged:
0
Best Answer
-
jwpfau Employee-RapidMiner, Member Posts: 303 RM EngineeringHi vans,
delete the Create Document and Write Document operators of Marco Barradas example and choose your local file for the csv file parameter of the Read CSV operator.
Check the LEARN section at the bottom of this webpage and/or complete the in-product tutorials to get a feeling for the process workflow.
Greetings,
Jonas0
Answers
Just remove the $ or % and convert it into a number you can do this with the the Replace and Nominal to Numerical operator.
Or you could use the Generate Attributes operator with it's replace and parse functions.
Greetings,
Jonas
Here is a little example on how you can do what you asked.