LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Python Node

    Employee
    Posted 01-08-2016 04:02

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: akash_123srm

    Hi guys, I have in my column 100 rows.I want to extract data from rows 50-70.How can I accomplish this using Python node ?

    Thanks


  • 2.  RE: Python Node

    Employee
    Posted 01-08-2016 07:52

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    You don't need python, unless there is some other complexity to the data.

    There are many ways to deal with this, but here's one of the simplest.
    If you want to select rows 50 thru 70 of an input set, use a Filter node with this bit of brainscript:

    emit *
    where execCount >= 50 and execCount <= 70
    If the dataset has a large number of records, this will speed it up a good bit:
    emit *
    where execCount >= 50 and execCount <= 70
    if execCount>70 then consume(1,true)   #stop reading more input records