Re: How to flatten only one sub list of list of lists

2017-04-01 Thread Robert L.
On 3/1/2017, Sayth Renshaw wrote: > How can I flatten just a specific sublist of each list in a list of lists? > > So if I had this data > > > [ ['46295', 'Montauk', '3', '60', '85', ['19', '5', '1', '0 $277790.00']], > ['46295', 'Dark Eyes', '5', '59', '83', ['6', '4', '1', '0

Re: How to flatten only one sub list of list of lists

2017-03-01 Thread Sayth Renshaw
> Replace the slice row[index:index+1] with row[index], either by building a > new list or in place: > > >>> def show(data): > ...for item in data: print(item) > ... > >>> def flatten_one(rows, index): > ... return [r[:index] + r[index] + r[index+1:] for r in rows] > ... > >>> def

Re: How to flatten only one sub list of list of lists

2017-02-28 Thread Peter Otten
Sayth Renshaw wrote: > How can I flatten just a specific sublist of each list in a list of lists? > > So if I had this data > > > [ ['46295', 'Montauk', '3', '60', '85', ['19', '5', '1', '0 > [ [$277790.00']], > ['46295', 'Dark Eyes', '5', '59', '83', ['6', '4', '1', '0 >

Re: How to flatten only one sub list of list of lists

2017-02-28 Thread Jussi Piitulainen
Sayth Renshaw writes: > How can I flatten just a specific sublist of each list in a list of lists? > > So if I had this data > > > [ ['46295', 'Montauk', '3', '60', '85', ['19', '5', '1', '0 $277790.00']], > ['46295', 'Dark Eyes', '5', '59', '83', ['6', '4', '1', '0 $105625.00']], >

How to flatten only one sub list of list of lists

2017-02-28 Thread Sayth Renshaw
How can I flatten just a specific sublist of each list in a list of lists? So if I had this data [ ['46295', 'Montauk', '3', '60', '85', ['19', '5', '1', '0 $277790.00']], ['46295', 'Dark Eyes', '5', '59', '83', ['6', '4', '1', '0 $105625.00']], ['46295', 'Machinegun Jubs', '6', '53',