Replace row with Average data from above and below row.

Hello,

I have the following table and I would like to the following.

image

  • Replace the 2021-01-21 row with an average of the top and bottom row.
    How do I achieve this ?

Hello,

Does this help?

middle average.knwf (17.5 KB)

3 Likes

Thank you. This works.

There is a missing value node in KNIME. Just use the mean as your fill value and you should get your results
bR

Thanks @Daniel_Weikert
Actually the data i have is not missing, just that that row is not representative of the data before and after.
image
Unfortunately, the solution given previously did not work for me.

Is it because of the Date column? Using RowID node if thats converted into index will that help?

@rd2575691 and @Daniel_Weikert

Here is the work flow:
image
after I transpose, the rows which are now columns don’t appear in the columns list in the Math Formula config.
image

I was thinking of the following options:

  1. Have a python script that can easily do this for me.
  2. Create a empty row with empty data, concat the row into the original table and treat it as missing values and the missing values node will fix that for me.
  • How do I know size of the original table
  • How do I create a time series by making the date column as the index. Since this is a time series problem.

Thanks.

  • How do I know size of the original table : Extract Dimension node
  • How do I create a time series by making the date column as the index. Since this is a time series problem : RowID Node

Thank you. @rd2575691
Do you think this is a good approach ?
Or any approach that gets you a result is a good approach ?

middle average_v2.knwf (62.3 KB)

Will this work?

Thank you again @rd2575691

I created this one. this works perfect.
image

I am so used to having the table that contains the totals (row and column) from my experience in Python.
How can I do that.

Thanks

JD

1 Like

On to Time Series forecasting…

You mean like this?
middle average_v3.knwf (72.7 KB)

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