Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
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, 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.