processing small but (perhaps) complicated dataset

Hello to everybody,

I have table like this:

    action action action action
day1 tree bird1 bird2 . bird j
  1 out200in300out30in910 out100in200out1140 . out200in300out940
  2 out500in100out840 out300in100out10in10out10in10out1400 . out1440
  . . . . .
  . . . . .
  . . . . .
  . . . . .
  n=40 out1440 out1440 . in100out 1340
day2   bird1 bird2 . bird i
  1 out300in300out50in790 out100in200out1140 . out200in300out940
  2 out600in50out790 out300in100out10in10out10in10out10in10out980 . out1440
  . . . . .
  . . . . .
  . . . . .
. m=40 out1440 out1440 . in100out 1340
. . . . . .
. . . . . .
    . . . .
dayk (k=maksimum 31) 1 . . . .
  . . . . .
  . . . . .
  . . . . .
  o=39 out1440 out1440 . in100out1340

 

 

and I want process it to the table like beneath:

output table           
tree 1          
day 1  minutes          
1 0 0 0 0 1
2 0 0 0 0 1
. . . . . .
. . . . . .
. . . . . .
1440 0 0 0 0 0
. . . . . .
. . . . . .
. . . . . .
day k minutes          
1 . . . . .
2 . . . . .
. . . . . .
. . . . . .
. . . . . .
1440          
. . . . . .
. . . . . .
. . . . . .
. . . . . .
tree m 0 0 0

0

0

 

I have trained Knime nodes (from ETL data manipulation) but i have no idea how to do it.

Main proble for me is how to transform data like: "out300in300out50in790" into the rekords of output.  Inputs consists of the rekords, which notes (in minutes) whether bird was or was not on the tree. Output is the registry of 0 (unpresent) 1 (present) of birds on the trees in succesive minutes every day. 

The next important problem (for me) is that number of birds are sometimes equal 8 sometimes 10.

Could anybody help me?

Thanks in advance

ps 

I attached excell file, but it is not input yet. I create it from word file and manual records..

 

 

 

Hi MB,

definitely not a trivial task, but perfectly doable. This is not a kind of homework, isn't it?

To get you started I have put together a workflow that turns an action string like "out300in300out50in790" into a table with a single column containing 300 rows of zeros, followed by 300 rows of ones, then 50 of zeros and finally 90 of ones. This corresponds to one day, one tree and one bird of your sample output.

If you try with a different action string it will convert it anyway into the right sequence. Note that the workflow has no check to whether the total minutes in an action string add up to 1440 or to something different. It also doesn't check if an action string is valid or not, so it always assumes it is a valid one.

There may be a smarter/simpler way to do it, but this is what I could come up with in a short time.

You should be able to complete the rest by yourself, mostly by looping over the days, tress and birds to produce your final output.

Regarding your variable number of birds, the core workflow shows you how to count something, turn it into a Flow Variable and then use that variable to control/size the output. I assume you can using something similar to overcome this problem.

Hope this helps.

Cheers,
Marco.

Thanks a lot Marco

for "idea" and workflow. No it is not a homework. The data come from my ftiends observation. He is not a scientist. He is artist and garden owner.

Now I upgrade my Knime to 3.2 version to be able to read knwf file.

 

 

Thanks a lot Marco

for "idea" and workflow. No it is not a homework. The data come from my ftiends observation. He is not a scientist. He is artist and garden owner.

Now I upgrade my Knime to 3.2 version to be able to read knwf file.

 

 

Hi MB,
you are welcome. You can always rename the knwf file to zip and import it in KNIME 3.1, however it always recommended to upgrade to the latest release if possible.
Let me know if it works and if it helps your friend.
Cheers,
Marco.