I have a table with 3 columns: bid_price and bid_size, db_name
bid_price, bid_size, db_name column for example has multiple entries (each of the entry is a list ). Below is an example:
bid_price bid_size db_name
5 4 3 2 1 10 20 30 40 nasdaq
nyseice
cboe
4 3 1 30 10 20 nyse
cboe`nasdaq
Now I only want each entry to have number of elements such that the bid size is 31.
That is the resultant table should look like:
bid_price bid_size db_name
5 4 3 10 20 30 nasdaq
nyse`ice
4 3 30 10 nyse
cboe
Do note that in the above table I deleted bid_prices and db_names that were extra to keep the number of bid prices and db_names consistent with bid size. How do I do this?
Let me know if the question is not clear?
how about
q)t:flipbid_price
bid_sizedb_name!((5 4 3 2 1;4 3 1);(10 20 30 40;30 10 20);(
nasdaqnyse
icecboe;
nysecboe
nasdaq))
q)({min(count x;1+sumsbinr 31)}@'tbid_size)#''t<br>bid_price bid_size db_name <br>-----------------------------------<br>5 4 3 10 20 30
nasdaqnyse
ice
4 3 30 10 nyse
cboe
On Fri, May 8, 2015 at 12:55 PM, Varun Tomar <varun.umich@gmail.com> wrote:
> I have a table with 3 columns: bid_price and bid_size, db_name
>
> bid_price, bid_size, db_name column for example has multiple entries (each of the entry is a list ). Below is an example:
>
> bid_price bid_size db_name
>
> 5 4 3 2 1 10 20 30 40 nasdaq
nyseice
cboe
> 4 3 1 30 10 20 nyse
cboenasdaq \> \> Now I only want each entry to have number of elements such that the bid size is 31. \> \> That is the resultant table should look like: \> \> bid\_price bid\_size db\_name \> \> 5 4 3 10 20 30
nasdaqnyse
ice
> 4 3 30 10 nyse
cboe
>
> Do note that in the above table I deleted bid_prices and db_names that were extra to keep the number of bid prices and db_names consistent with bid size. How do I do this?
>
> Let me know if the question is not clear?
>
thanks a ton Charles! that was magic!