Questions tagged [find-occurrences]

435 questions
0
votes
1 answer

Counting the most frequent sequence occurring in a string

Full Code is here: https://nekobin.com/yehukomiya (Don't mind the computeFile() function) Hi, I've got a text file with repeating chars in binary string like "0101001001111000010010011110010000000" I already got the KMPSearch() function that I use…
MattMlgn
  • 33
  • 7
0
votes
0 answers

Search and Count number of occurrences of a specific text in JSON file

would love some help please. I am trying to write a script to search a JSON file and count the number of occurrences of multiple groups of text. This is what i have so far. Just trying to count 1 to start with. In the end i would love to be able…
JPC882
  • 1
  • 1
0
votes
1 answer

How to count the occurence of each word from the string? Dart

void main (){ print(occurence("hello hi hello one two two three")); } occurence(text){ var words = text.split(" "); print(words); var count = {}; words.map((element) => { if (count[element]){ count[element]+=1 }else{ …
Ayz
  • 181
  • 1
  • 9
0
votes
1 answer

Counting the variables that occur most often next to each other

I'm working with a large database and I want to see which variables are most often found in each other's environment (i.e. in the same row). There can be more than 20 variables in a row and I don't know all of them. Here is an example: var1 <-…
onlyjust17
  • 125
  • 5
0
votes
1 answer

C++, 3D arrays, find target and its occurrences. My problem is, my elements only displaying zeros but i want to display 0-9 random numbers

#include #include #include using namespace std; int count_occurrences(int array[3][3][3], int size, int target) { int result = 0; for (int i = 0; i < size; ++i) { for (int j = 0; j < size; ++j) { …
0
votes
0 answers

Fetch the next strategy based on the old strategies in MySQL

I have the following problem: I have a table with 4 thousand records with the following columns, id, strategy, option and data. The numbers are random, line by line. I needed to check if the previous 3 records are part of my pattern and search…
0
votes
0 answers

Counting number of co-occurrences of words for a specified vocabulary and within a specified radius?

I have a vocabulary V = ["anarchism", "originated", "term", "abuse"], and list of words test = ['anarchism', 'originated', 'as', 'a', 'term', 'of', 'abuse', 'first', 'used', 'against', 'early', 'working', 'class', 'radicals', 'including', 'the',…
Jake
  • 275
  • 4
  • 11
0
votes
2 answers

How can I store the occurences of a number in a sudoku subgrid (3x3)?

So I've been trying to store all the occurences of numbers from 1 to 9 in an array. I've succeeded for rows and columns and tried to apply the same logic for subgrids of 3x3 but to no avail. My sudoku grid is a 2D array 9x9 (purposefully put two 9…
yk87
  • 3
  • 2
0
votes
3 answers

Get maximum occurance of one specific value per row with pandas

I have the following dataframe: 1 2 3 4 5 6 7 8 9 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 1 1 0 1 0 2 1 1 0 1 1 0 0 1 1 ... I want to get for each row the longest sequence of value 0 in the…
Reut
  • 1,555
  • 4
  • 23
  • 55
0
votes
0 answers

How to create a Co-occurrence matrix between values and csv in R

I have 5 values : chr [1:5] "A", "B", "C", "D", "E". And one csv table and one column in this csv file is "Letter" which some Letter contains the above 5…
island1996
  • 47
  • 5
0
votes
2 answers

Perl script for counting occurrences of three different IDs in string where occurrence may be zero

I've attached below an example featuring 5 lines from my input file (tab-delimited): G157 G157.2 535 3 344 344:m64019_201112_211057/51839190/ccs,m64019_201112_211057/167772263/ccs,m64019_201112_211057/152963146/ccs G157 G157.6 535 42 …
winstonhc
  • 23
  • 5
0
votes
1 answer

Can I apply tf.math.bincount on a rank 3 tensor without for loop?

I would like to get the occurrences of numbers of a 3 dimension tensor (displayed in a tensor at the corresponding indexes, like tf.math.bincount does). For a 2d tensor, you can simply do this: T = tf.round(25*tf.random.uniform((5,8))) bincounts =…
0
votes
1 answer

Count the occurrences of a wordlist within a string observation

I've a list of the top 10 most occurring words the abstract of academic article. I want to count how many times those words occur in the observations of my dataset. The top 10 words are: top10 = ['model','language','models','task', 'data', 'paper',…
0
votes
3 answers

SML, How to find number of occurrences of the minimum number in a list?

In SML is it possible to find the number of occurrences of the min number in a list? I have code to find the number of occurrences of a number but i am stumped on how to find the min and use it to find how many of the minimum num there is. fun…
ulysessg
  • 11
  • 3
0
votes
2 answers

C Program to Count Frequency of Element

I have this code which finds occurrence of number from numbers entered by user. My question is how to firstly enter numbers by user and then ask user to find his number in the sequence. I'm sorry if this question is stupid, but I'm just a beginner…