Questions tagged [find-occurrences]

435 questions
1
vote
1 answer

Finding the largest Occurrence of a digit in an array of integers

I need some advice on an assignment that asks to write a function to find the even digit that has the largest/smallest occurrence. My output should look like: How many integers (to be worked on) ? 2 Enter integer #1: 1230476 Enter integer #2:…
1
vote
1 answer

search array for duplicates php

It's been years since I've used PHP and I am more than a little rusty. I am trying to write a quick script that will open a large file and split it into an array and then look for similar occurrences in each value. For example, the file consist of…
1
vote
2 answers

Counting occurrences of a string in an array (javascript)

I have a code... var userArray=userIn.match(/(?:[A-Z][a-z]*|\d+|[()])/g); ...that separates the user input of a chemical formula into its components. For example, entering Cu(NO3)2N3 will yield Cu , ( , N , O , 3 , ) , 2 , N , 3. In finding…
Rygh2014
  • 135
  • 1
  • 1
  • 10
1
vote
1 answer

How to mark reference usages in Eclipse?

How to automatically show the usages of local variables, fields, methods, classes and so on? Notice: The mark occurences function in Eclipse does exactly what I want (see Eclipse editor show variable occurrence), BUT... It doesn't update when I move…
MC Emperor
  • 22,334
  • 15
  • 80
  • 130
0
votes
2 answers

R: table function for objects in datetime string?

I have a large matrix with a column of datetime information. The structure is: '2022-01-01_0545'(no seconds). I'm looking for an effective way to get the number of occurrences of each year, month and day in my matrix. What could be a good…
s28
  • 173
  • 5
0
votes
2 answers

Remove N occurrences of each item in a list

I am trying to remove N occurrences of each item in a list using python, this is the code I am using : numbers = [1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3] n = 2 result = [] for i in set(numbers): if numbers.count(i) > n: …
Poonam
  • 31
  • 1
  • 4
0
votes
0 answers

Sparql: Counting the number of occurrences of a specific string/charater/diacritic in text using owlready2

I have an ontology in an 'owl' file (quran_data_full.owl) and I saved it in a folder in my google drive (Quran Corpus). To perform some queries in this ontology, first I tried the query on Apache Jena Fuseki. It gave me the correct results so I…
Reem
  • 107
  • 1
  • 7
0
votes
1 answer

How to get the 'number' of occurrence of a value in a column in another column in a pandas dataframe

I need to get the exact 'number' of occurrence of a particular value in a column in another column in dataframe. To make it simpler, need the cumulative count of a repetitive value in a column Consider the following…
0
votes
1 answer

Is there any way to seach for coincidences in Excel, in order to know how many times two different values have the same ID

I have a two tables like the following: This is the first table. Here, I have an ID to refer the log, and some data about that particular…
Az JRC
  • 5
  • 4
0
votes
0 answers

Counting presence or absence of tallies by rows

Hi I am not sure how to explain what I need but I'll try. I need a query (if there is one) for counting if a tally was present in a point (column). So all species with more than one tally in a point will count only as one. This is how the data…
Joa Lu
  • 1
0
votes
4 answers

Check all occurrences of a letter appear before another letter C++

I have a string S consisting of N letters 'a' or 'b'. This should return true when all occurrences of 'a' are before all occurrences of 'b' and return false otherwise. b does not need to occur in S and a does not need to occur in S For…
Teo
  • 1
0
votes
1 answer

count_alpha in c languahe, a programme that counts occurances of letters in a string and prints the letter next to its count number

can someone advise how can I print the repeating letter with its final count/occurance once? I have the following code and after it the output but I want the output to be: 2a, 1b, 3c instead of 1a, 2a, 1b, 1c, 2c, 3c #include #include…
MSU
  • 1
  • 1
0
votes
0 answers

Create a co-occurrence matrix from a single column of observations

I have a series of data frames, each with an individual identifier (in this example a letter A-E), and the site number it was observed at. In this example, I have 3 data…
Vint
  • 413
  • 6
  • 17
0
votes
1 answer

Count occurance of 2 list, but without duplicate the counter

I have to count the occurrence between two lists of strings. I need this function to complete my mastermind game. The problem is that I manage to count the occurrences but they are duplicated because of course you can't delete an element from a list…
0
votes
2 answers

Finding the most occurring letter in every position of a string in a list of strings

I have a list of strings called words such that words = ['house', 'garden', 'kitchen', 'balloon', 'home', 'park', 'affair', 'kite', 'hello', 'portrait', 'angel', 'surfing'] I have to find the most occurring letter in every position the…
MattMlgn
  • 33
  • 7