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
116 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,950 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
• 57,550 points
279 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,520 points
251 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 in Python by Sirajul
• 55,750 points
34 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
• 57,550 points
259 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
• 32,460 points
10,859 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
78 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,050 points
405 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,380 points
190 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,950 points
102 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,950 points
59 views