String to Number

Hello, dear colleagues, today I get another one problem, it concerns String to Number node. I have dataset called “Space missions 1957-2020” downloaded from Kaggle to make exercise. There is the column called “Rocket”, it contains price value, but now it has String format, for my analysis I need Number format. But in some rows the value is with comma (,) separator, in some - with dot (.). So does it mean that I need to use String to Number node twice and then combine them somehow (which node can be used in this case?) or it can be done using another one approach (node/nodes)?

Thank you in advance.




Hi @Felis90 , in your screenshot of the config, the thousands separator field is empty. What happens if you put a comma in there, since your data has commas as the thousands separator.

2 Likes

Is it that . and , are mixed as decimal separator? e.g. sometime you have 50.0 and in other cases 50,0

Or is it that you have . as decimal separator and , as thousands separator? e.g. you always have 50.0 and then for larger numbers you have 1,000,000.0?

Depending on this the solution may look different…

2 Likes

hi @Felis90,

If the comma is a thousands separator, you can mention it in configuration dialog box. It should solve the issue.

3 Likes

@MartinDDDD
The values are varying from 5.3 -450.0, but sometimes I have 5,000-1,160 (about 14 cases)… I think it is in dollars and as it space missions it could be millions and thousands… probably…

From what I can see I think trying what @takbb and @yogesh_nawale proposed should work!

Have you tried to change the configuration of your String to Number node as per the screenshot from yogesh above yet?

1 Like

It seems that it works! Thanks a lot, colleagues!


1 Like

@yogesh_nawale @MartinDDDD @takbb
Hello for everybody!
I have a problem with statistics after the transformation, because the system see the maximum value in Launch Services Price column, which is 5,000 (thousands dollars, if we are speaking as expert) but the minimum is 0, which seems ok, but when I also play with values cleaning against missing values in Launch Services Price, in this case I had the minimum that is 5.3 (million dollars) and the maximum is 350 (million dollars), but in fact the minimum is 1,160 (thousands dollars) and the maximum is 450 (million dollars). It is so strange… can you explain me what mistake I have made?



This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.