Using filter() and map() together

0 votes
I have the following piece of code:

c = map(filter(lambda x: (x>=3), (1,2,3,4)),[1,2,3])
print(list(c))

But I get an error as "   'filter' object is not callable". What should I do?
Jul 26 in Python by Fata
• 1,040 points
27 views

1 answer to this question.

0 votes

You are not providing the parameters in the right manner. Use the following:

EXAMPLE:

c = map(lambda x:x+x,filter(lambda x: (x>=3), (1,2,3,4)))
print(list(c))

OUTPUT:

[6, 8]
answered Jul 26 by Wajiha
• 1,920 points

Related Questions In Python

0 votes
1 answer

Using filter, map, and reduce in Python

A quick implementation might look like this: from ...READ MORE

answered Nov 2, 2018 in Python by Priyaj
• 56,920 points
99 views
0 votes
1 answer

How to filter HTML tags and resolve entities using Python?

Him the answer is a pretty simple ...READ MORE

answered Feb 13 in Python by Nymeria
• 3,520 points
60 views
+1 vote
1 answer

How can I map input to output without using dynamic()

Here am talking about my example you ...READ MORE

answered Aug 8, 2018 in Python by Priyaj
• 56,920 points
157 views
0 votes
1 answer

Using Lists and Tuples in Python

if you are familiar with C programming, ...READ MORE

answered May 29, 2018 in Python by Nietzsche's daemon
• 4,260 points
90 views
0 votes
2 answers

How to remove rows with missing values (NAs) in a data frame?

Hi, The below code returns rows without ...READ MORE

answered Aug 20 in Data Analytics by anonymous
• 31,840 points
5,575 views
0 votes
1 answer

Is it possible to apply filter just to one of the measures

Hey @Ghost, Why don't you use Level of Detail ...READ MORE

answered Apr 17, 2018 in Tableau by Atul
• 10,240 points
46 views
0 votes
1 answer

Getting error in Hadoop Streaming: Type mismatch in Key from Map

In Hadoop streaming you have to customize ...READ MORE

answered Apr 18, 2018 in Big Data Hadoop by coldcode
• 2,020 points
269 views
0 votes
1 answer

How to set the number of Map & Reduce tasks?

The map tasks created for a job ...READ MORE

answered Apr 18, 2018 in Big Data Hadoop by Shubham
• 13,310 points
93 views
0 votes
1 answer

Length and dimensions of NumPy arrays

The length of NumPy arrays can be ...READ MORE

answered Jun 14 in Python by Wajiha
• 1,920 points
28 views
0 votes
1 answer

Slicing a list using a variable, in Python

Yes its possible. Use the following piece ...READ MORE

answered Jul 2 in Python by Wajiha
• 1,920 points
28 views