Questions tagged [any]
"Any" means "at least one". Use this tag for questions that deal with testing elements in a collection to see if at least one of them passes a condition.
694
questions
-3
votes
1
answer
64
views
Does filter have a way to export the "list" one element at a time?
On a practice exercise about prime numbers I found out that filter does not return a list itself and I need to do:
list(filter())
to obtain that list.
I do the exercise twice, once with a for loop:
...
0
votes
3
answers
101
views
Which is more efficient Dictionary.TryGetValue or List.Any
I have a case where I have to find out if element belongs to a list or not in loop.
The straight forward way to do this is to call the Any method of the list, like this
public class Person
{
...
1
vote
1
answer
64
views
Handling Dynamic Outputs in Swift Functions Without Sacrificing Type Safety (Any)
I have a basic custom structure in Swift where using Any for input types is less than ideal due to the language's statically typed nature, which can bypass the compiler's type checking and lead to ...
-1
votes
1
answer
18
views
what should I give instead of 'any' while defining the custom styles for react-select?
enter image description here
I have such a file where I have defined the custom CSS styles for my react-select select component and it works perfectly, but the any in the parameter definition is ...
0
votes
0
answers
49
views
How to support Any in codable?
I am trying to integrate SwiftData for storing data in my app, which currently uses objectmapper along with alamofire for mapping json data into models. For using swiftData, it requires that the ...
0
votes
0
answers
53
views
Create an Object From Raw Pointer and Metadata [duplicate]
I am trying to do something complex in rust with wasm_bindgen I cannot export generic structs/functions from rust to javascript.
What I'm trying to do is something like this.
some function
pub fn foo()...
0
votes
0
answers
45
views
google.protobuf.any variable put in to int array in C++
`Hi, I have a variable called mapData in google.protobuf.any type. how would I put that mapData infoamtion in to an int array in in C++. I am using proto3 syntax.
Appreciate some help on this
Thank ...
1
vote
1
answer
53
views
per-row boolean operations in pandas
I have a Pandas Dataframe (see below). I'm trying to find a fast (and concise!) way to generate a column d containing a boolean, that is true, if any of a, b or c in the corresponding row are True. ...
-1
votes
1
answer
123
views
How to add ANY operator into an AVG in CASE SQL statement
We have a stored procedure that averages snow conditions on local reports and then shoots out a set percentage for the county. That county is put on an interactive map and shades of colors are applied....
5
votes
4
answers
100
views
In R, how count if a value is in any specific columns in the same dataframe?
I have this dataframe, i want to count a value in VAL1-VAL3, and sum it if is in T1-T5
VAL1 <- c(1,3,2,4,9)
VAL2 <- c(5,6,3,1,2)
VAL3 <- c(7,5,5,9,5)
T1 <- c(4,2,6,4,8)
T2 <- c(10,1,...
0
votes
2
answers
201
views
C++17 Dictionary of names to any
I'm trying to create a dictionary in C++17 which associates a name to a pointer of any number of types simultaneously, and is able to deduce back the type on lookup without resorting to explicit casts ...
1
vote
2
answers
325
views
Pandas .any() vs. Python any() on Dataframe
What is the reason to prefer Pandas implementation of .any() instead of Python's builtin any() when used on a DataFrame? Is there a performance reason to this, since Pandas DataFrames are column-...
-2
votes
1
answer
79
views
how to find a sequence of characters in an array and know how many times it appeared
Please, I need help finding out if the sequence in my array is present in another array, but I need to know how many times this same sequence has been found. I have this but it only returns if found ...
0
votes
1
answer
47
views
How prevent catastrophic backtracking with multiple negative lookaheads
I have a dataframe with strings in one column. I would like to add the words 'section 22' to a string when it contains the word 'personal information'; at the same time, I would like the section 22 ...
0
votes
2
answers
79
views
Equivalent of the logical any() in PuLP
Im using PuLP to solve a big MILP. As part of a more complex system of restrictions, I have an array of Boolean decision variables var_array, and an individual Boolean variable var_all_zeros.
I am ...