Questions tagged [find-occurrences]
435 questions
0
votes
1 answer
Speed Up Finding Occurrences in Multiple Sheets via VBA
with the below code I m finding how many times a contact has been reached. In order to do so, the formula is using a named range (Weeks) and search for the partner name across multiple sheets.
I am not using a simple formula because the file change…

Kurt
- 135
- 2
- 11
0
votes
1 answer
Count occurences of phrases in lowercase sentences without punctuation
Example Inputs:
peter warns pete to not go to the sea
alfred should go to the sea
albert warns pete
i told you to not go to disneyland
Example Outputs:
3: go to
2: go to the sea
2: to not go to
Optional:
Do not count occurrences below 2.
My…

Heiko Hanisch
- 11
- 3
0
votes
3 answers
Is there a way to return character occurrences in a string array without using any built in functions?
I'm having troubles with my function where I need to find how many times the character appears in the strings inside an array. We are not allowed to use any built in functions so array.toString() is not possible. So far, this is the code I came up…

YabaiTV
- 5
- 4
0
votes
2 answers
Finding occurrence of specific event in a day in R
I have two question
First, I want to find the number of occurrences/repetitions of a specific event after a gap in a given day using R. Below is my sample…

Karthik
- 117
- 7
0
votes
2 answers
Count word occurrences inside elements in XML directory
I have a folder with XML files and I´m trying to count the occurrences of specific words inside one element. More specifically, I want to count the occurences of , for example, the word "Impfstoff" (which is in the element "mpeg7text:Keyword") in…

kathi94
- 29
- 3
0
votes
1 answer
Counting the number of occurrences of al the random numbers inside of an array
I wrote this code to display a table of random numbers between two values using vanilla JavaScript, I used an array to store the random values, and then I displayed them on the page using tales. and I want to count the number of occurrences of every…
0
votes
1 answer
How to count occurrence of a given number in an Array using ReactJS
I store the result of my Flask server in this.state.jsondata and it's a JSON like this {label{},text{}}
export default class Success extends React.Component {
constructor(props) {
super();
if (props.location.state) {
…

Jérôme Vial
- 15
- 1
- 5
0
votes
3 answers
counting the occurrences in a list of lists python
I have a list of lists in python:
x=[['1', '1', '2', '2', '2', '2', '1', '0', '0'],
['1', '1', '1', '0', '0', '1', '1', '0', '0'],
['0', '0', '1', '2', '1', '0', '2', '1', '1']]
I want to know how count the occurrences in the list of lists
My…

dominique
- 11
- 1
0
votes
1 answer
Count the occurrence per nested list in another list in Python
I am struggling with getting the output that I want. I have two lists as illustrated below:
h3_FP_DB = [['KE', 'EH', 'LA'], ['KE', 'EH'], ['KE'], ['EH'], ['KE', 'EH']]
h3_FP = [['KE'], ['KE', 'LA'], ['KE', 'EH', 'LA'], ['KE', 'EH'], ['LA'], ['LA',…

MxGr20
- 77
- 6
0
votes
1 answer
Distance between consecutive occurrences of a character
I need to write a program that will determine the length of the spaces between successive occurrences of a given character. If the occurrences are adjacent, the space between them is considered to be 1.
I can only calculate between two signs
text =…

Maria
- 3
- 2
0
votes
1 answer
Mongodb / mongoose aggregate - counting string occurrences of a field in a nested document it returns _id with the same name - counts are right
I'm trying to count the number of different string occurrences in a nested (sub) document in my MongoDB collection called Events.
First:
It's looks for the specific Event Id with $match
Then it $unwinds the nested document called requestList
Then…
0
votes
1 answer
Replace and/or remove first n occurrences of specific JSON key-value string from code file in PCRE Regex-supported Editors
I have many PHP code files, where I have to find and replace/remove specific JSON key-value string from those PHP files with any text editors that support PCRE-Regex.
The string I have to find and remove (replace with nothing, not even space), that…

Vicky Dev
- 1,893
- 2
- 27
- 62
0
votes
4 answers
How to find index of elements of a list that have occurrance of exactly 2 in Python
I'm trying to write a code which returns ALL indices of the elements from a list, which are repeated EXACTLY TWICE. I'm having trouble with my own algorithm. My code only returns the FIRST occurrence it finds. I want this fixed. Here's my own code…

Liana
- 314
- 5
- 15
0
votes
3 answers
Python: Count the occurence of value in nested dictionary if other value is true
I have a nested dictionary that looks like this:
{
1: {'Name': {'John'}, 'Answer': {'yes'}, 'Country': {'USA'}},
2: {'Name': {'Julia'}, 'Answer': {'no'}, 'Country': {'Hong Kong'}}
3: {'Name': {'Adam'}, 'Answer': {'yes'}, 'Country': {'Hong…

Sam333
- 199
- 14
0
votes
4 answers
What is the best possible way to find the first AND the last occurrences of an element in a list in Python?
The basic way I usually use is by using the list.index(element) and reversed_list.index(element), but this fails when I need to search for many elements and the length of the list is too large say 10^5 or say 10^6 or even larger than that. What is…

Rishi Garg
- 21
- 3