Column Splitting

Hi
I am trying to creating new columns by copying the data in a given column according to the groups it has in another column

Hi @ShivaniGrover and welcome to the forum

I don’t know if there is a question in this topic… But did you try the Rule Engine node? If you need more help, please be more specific about how your input looks like and what output you expect. Happy KNIMEing.
gr. Hans

So, I have a column in which some of the cells have gender.age_range, while other have just gender. So, I want to create 3 new columns such that one column has gender and other has age_min and age_max
ex.
I have
col1
F.50-90
M. 20-30
U.12-78
and I want
col1 gender age_min age_max
F.50-90 F 50 90
M. 20-30 M 20 30
U.12-78 U 12 78
Please help

Hi @ShivaniGrover

With the Cell Splitter node you can split the column, see this wf split_column.knwf (19.5 KB)
gr. Hans

1 Like

Hi @ShivaniGrover and welcome to the KNIME community forum,

In addition to the solution provided by @HansS, you could also use the regex pattern below in the Regex Split node:

([A-Za-z]*)[.\s]*(\d*)[-\s]*(\d*)

I have use asterisks so if some data is missing the pattern still works.

:blush:

3 Likes

Got it… Thank you

Got it… Thank you.
Now, I have another problem. I am creating a decision tree model. Now when I try to use scorer node after using the predictor node, it stops executing after 50%. The predicted variable and the target variable are continuous… please help

Hi @ShivaniGrover -

If your target variable is continuous, try using the Numeric Scorer node instead of the Scorer node. If you are still having trouble, please post a workflow with a toy dataset so we can troubleshoot further.

2 Likes

Thank you… It worked

Hi
I am facing another issue for which i dont know the node to use.
I have a table
S.No Name value
1 a 1
2 a 11
3 b 22
4 c 80
5 d 89
6 b 20
7 d 90

and I want something else
S.No Name value a b c d
1 a 1 1 ? ? ?
2 a 11 11 ? ? ?
3 b 22 ? 22 ? ?
4 c 80 ? ? 80 ?
5 d 89 ? ? ? 89
6 b 20 ? 20 ? ?
7 d 90 ? ? ? 90
How to do it in KNIME?
Please help

You should be able to use the Pivoting node for that. Use Name as the pivoting value.

1 Like

Then what to give in groups and aggregate columns. It does not execute without some metric in all three windows- groups, pivots, and aggregate column

Hi @ShivaniGrover

With the tip fro @ScottF you are almost there. Use S.No column as Groups, Name as the pivoting value. And use Value column in the aggregation. You can use first as aggregation method, this gives the result you want. There is a difference in aggregation methods you can use if the columns has Integer or String values. Do some experimentation, I suggest.

gr. Hans

2 Likes

I am getting java heap space error everytime. I tried to increase the space but cannot find knim.ini file in KNIME directory. I am windows user. Please help urgent.

Hi there @ShivaniGrover,

third column is file type and there you can see that one file named knime has value/description Configuration setti.... That is the one you are looking for. Just a note - you are not seeing extenions (.ini for this knime file) because you have probably checked option on Windows to hide extensions for known file types :wink:

Br,
Ivan

3 Likes

Thank you… It worked

1 Like

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