On Thu, Jul 15, 2010 at 9:50 AM, Srinivas Reddy Thatiparthy <
srinivas_thatipar...@akebonosoft.com> wrote:
> I read from Python 2.6.3 docs that,copied from chm
>
> " Note that filter(function, iterable) is equivalent to [item for item in
> iterable if function(item)] if function is not None an
I read from Python 2.6.3 docs that,copied from chm
" Note that filter(function, iterable) is equivalent to [item for item in
iterable if function(item)] if function is not None and [item for item in
iterable if item] if function is None."
Since they said *equivalent* ,i thought both transfo
> List comprehensions are preferred to map and filter functions.In fact,
> filter is a syntactic sugar to list comprehension.
>
>
You're right in saying list comprehensions are preferred to map and filter -
not just from a readability standpoint but also from a performance
standpoint. (we all hate
> Suppose you have two nested lists, X and Y.
> A sample element of X is:
> ['NM_032291', '6741', '6751', 'chr1', '+']
>
> Another sample element of X is:
> ['NM_001097', '51183080', '51183635', 'chr22', '+']
>
>
> A sample element of Y is:
> ['chr1', '6746']
>
> Another
>map (function, list1, list2) where in function you can create your desired
>list.
List comprehensions are preferred to map and filter functions.In fact, filter
is a syntactic sugar to list comprehension.
Regards,
Srini T.
--When you are playing cricket, you should hit the ball out of the gro
On Wed, Jul 14, 2010 at 9:01 AM, Shashwat Anand wrote:
>
>
> On Tue, Jul 13, 2010 at 8:00 PM, Vikram wrote:
>
>> Suppose you have two nested lists, X and Y.
>> A sample element of X is:
>> ['NM_032291', '6741', '6751', 'chr1', '+']
>>
>> Another sample element of X is:
>> ['NM_001097', '5
On Tue, Jul 13, 2010 at 8:00 PM, Vikram wrote:
> Suppose you have two nested lists, X and Y.
> A sample element of X is:
> ['NM_032291', '6741', '6751', 'chr1', '+']
>
> Another sample element of X is:
> ['NM_001097', '51183080', '51183635', 'chr22', '+']
>
>
> A sample element of Y is:
>
I think you can very well use map function
map (function, list1, list2) where in function you can create your desired
list. What map will do is it will call function for each element from list1
and list2 (same indexed) and will do the stuff defined in the function.
Do let me know if i am close to
On Tue, Jul 13, 2010 at 02:30:41PM -, Vikram wrote:
> Suppose you have two nested lists, X and Y.
> A sample element of X is:
> ['NM_032291', '6741', '6751', 'chr1', '+']
>
> Another sample element of X is:
> ['NM_001097', '51183080', '51183635', 'chr22', '+']
>
>
> A sample eleme
Suppose you have two nested lists, X and Y.
A sample element of X is:
['NM_032291', '6741', '6751', 'chr1', '+']
Another sample element of X is:
['NM_001097', '51183080', '51183635', 'chr22', '+']
A sample element of Y is:
['chr1', '6746']
Another sample element of Y is:
['chrY',
10 matches
Mail list logo