filter tag

5 questions


1 answers
344 views
0
filter() function

# General functiondef even(x): if x % 2 == 0: return x# Listtwo = [i for i in range(10)]# filter() + general functionlist(filter(even, two))The expected output of is [0, 2, 4, 6, 8]The actual output ...

1 years ago

1 answers
80 views
0
[javscript][Algorism] Filter Function Question

Hello, the code below is Both the people and tshirts arrays are arranged in ascending order const fp = people.filter(person => { For(let item of tshirts){ // Change the array value if you are look...


1 answers
119 views
0
Tfidf Embedding Vectorizer question among Python word2vec.

from sklearn.feature_extraction.text import TfidfVectorizerfrom collections import defaultdictimport numpy as np TfidfEmbeddingVectorizer class TfidfEmbeddingVectorizer(object): def __init__(self, wor...


1 answers
89 views
0
What is the best way to filter a Java collection?

I want to filter java.util.Collection when implementing.

1 years ago

1 answers
93 views
0
I want to assign multiple strings to one variable, but I get an error. - - JavaScript

const arr = ['a', 'b', 'c', 'd', 'e']; var x = b || d || g || h || z; const the_number_of_x = arr.filter(i => i === x).length; if (the_number_of_x === 2) { console.log(success!) } } else { consol...


© 2024 OneMinuteCode. All rights reserved.