Using filter and map together

+1 vote
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, 2019 in Python by Fata
• 1,050 points
1,684 views

1 answer to this question.

+1 vote

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, 2019 by Wajiha
• 1,960 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
• 58,020 points
1,214 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, 2019 in Python by Nymeria
• 3,560 points
2,176 views
0 votes
1 answer

What is the difference between map() and filter() function in python?

The map() function is a type of ...READ MORE

answered Jun 25, 2020 in Python by Sirajul
• 59,230 points
2,586 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
• 58,020 points
1,014 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, 2019 in Data Analytics by anonymous
• 33,030 points
14,769 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
1,517 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,090 points
1,262 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,490 points
1,927 views
0 votes
1 answer

Length and dimensions of NumPy arrays

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

answered Jun 14, 2019 in Python by Wajiha
• 1,960 points
1,345 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, 2019 in Python by Wajiha
• 1,960 points
2,050 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP