Questions tagged [find-occurrences]
435 questions
4
votes
4 answers
RegEx match first occurrence before keyword
I have the following string:
- some words here.
- other words here.
- Code: 55555.

Florin C.
- 266
- 7
- 18
4
votes
6 answers
Keep the second occurrence in a column in R
I have quite a simple dataset:
ID Value Time
1 censored 1
1 censored 2
1 uncensored 3
1 uncensored 4
1 censored 5
1 censored 6
2 censored 1
2 uncensored 2
2 uncensored 3
2 …

Lb93
- 191
- 1
- 12
3
votes
1 answer
Spacy: count occurrence for specific token in each sentence
I want to count the occurrence of the token and for each sentence in a corpus using spacy and append the result for each sentence to a list. Until now the code bellow returns the total number (for the whole corpus) regarding and.
Example/Desired…

Artemis
- 145
- 7
3
votes
3 answers
Extract co-occurrence data from dataframe
I have something like this:
fromJobtitle toJobtitle size
0 CEO CEO 65
1 CEO Vice President 23
2 CEO Employee 56
3 Vice President CEO …

darklight213
- 83
- 4
3
votes
1 answer
Calculate Keyword Density of each Unique Element in List in Java?
I am able to calculate keyword density of a body of text using the following code:
HashMap frequencies = new HashMap();
String[] splitTextArr = StringX.splitStrIntoWordsRtrnArr(text);
int articleWordCount =…

alpha1
- 426
- 3
- 14
3
votes
1 answer
Elixir: How to find ALL occurrences of a value from a list of tuples?
Find all occurrences of {1, _}; in other words, all first element values that are 1 from each tuple in the list.
Consider the following input:
[
{1, 0},
{2, 2},
{1, 1},
{11, 1},
{1, 3},
{1, 2},
{13, 1}
]
Expected Output:
[{1,0},…

lattejiu
- 119
- 8
3
votes
3 answers
How to get the number of occurence of a keyword inside a string using mongoDb
I'm doing a text search using the $search operator in the aggregation below :
However i'd like to get the number of occurence of the matched keywords (not only the textScore that mongo provides)
myCollection= await MyCollection.aggregate(
…

Abdelmlak Dhif
- 469
- 2
- 11
3
votes
2 answers
pythonic way to count the number of times words from a list / set occur in a dataframe column
Given a list / set of labels
labels = {'rectangle', 'square', 'triangle', 'cube'}
and a dataframe df,
df = pd.DataFrame(['rectangle rectangle in my square cube', 'triangle circle not here', 'nothing here'], columns=['text'])
I want to know how…

v_coder12
- 170
- 2
- 9
3
votes
1 answer
c++ return all of the elements that appear n times in a vector as a vector
Goal: Return all elements in vector A that appear N times and put results in vector B.
Expected Result:
--Begin With---
Vector A=(10,20,30,30,40,50,100,50,20,100,10,10,200,300)
Do some code to return the name of elements that appear in Vector…

user3152377
- 429
- 1
- 5
- 17
3
votes
5 answers
finding the frequency of a key value pair in an object in javascript
imagine I have an object
teaherList =…

Naveen Kariyappa
- 93
- 1
- 7
3
votes
2 answers
Submit button to pass value to database and show the occurences of the value(laravel)
I'm new at programming, especially at laravel. I've tried a lot and now I try to make laravel project but get stuck at some problems.
I want to make the submit button to pass data to the database and find out the occurences of the value in the radio…

Dan
- 51
- 8
3
votes
1 answer
RFC5545. Calculate event occurrences for RRULE and EXDATE (EXRULE) at same time
I have to calculate event occurrences. Calculation should be based on recurrent event pattern. Recurrent event pattern is rfc5545 based.
I've found lib-recur library to calculate occurrences. Following description I see they provide calculation…

Sergii
- 7,044
- 14
- 58
- 116
3
votes
1 answer
Can anyone tell me if I'm using the proper code to print the occurrences in this ArrayList?
Okay, so what I'm trying to do is go through the ArrayList called theDateArray, do a search for a particular item in that list, and output how many times that item appears. When I test it in the main class, it just outputs the number 0 no matter…

Nathan777
- 79
- 8
3
votes
3 answers
Finding how many times a given string is a substring of another string using scala
what is the elegant way for finding how many times a given string is a substring of another string using scala?
The below test cases that should make clear what are the requirements:
import org.scalatest.FunSuite
class WordOccurrencesSolverTest…

GA1
- 1,568
- 2
- 19
- 30
3
votes
3 answers
Print list unique items in order of their frequency of occurrence
Let's say we have an array of integers or even continuous stream of integers. The idea is to print unique elements in descending order based on occurrence frequencies. For example, for 7, 4, 2, 4, 9, 6, 5, 6, 2, 0, 2, 1 we should get: 2, 4, 6, 7,…

whiteErru
- 275
- 1
- 5
- 13