Questions tagged [find-occurrences]
435 questions
1
vote
1 answer
Print multiple occurrences in a string
I'm trying to write a function where the input has a keyword that occurs multiple times in a string and will print the stuff that has double quotation marks between them after the keyword. Essentially...
Input= 'alkfjjiekeyword…

Anymee
- 121
- 1
- 12
1
vote
3 answers
Teradata how to select first occurrent
I have a table similar to the picture below. In this table, I have some duplicates in SESS_KEY. I only want rows that does not have duplicates or if rows that have duplicates, I only want the ones with CALL_TRNSF_FLG set to 1. I have manual create…

Mixer
- 183
- 2
- 7
- 15
1
vote
1 answer
Finding the occurrence and position of a character in python
I have a variable (var) with ids
I am interested in finding out the position of last occurrence of Z
I have tried to convert it to an array with their positions
zf1=np.where(df2['Var']=="Z")
This will give me the result as
…

sshr
- 145
- 1
- 10
1
vote
1 answer
Count occurences of a subarray in a bigger array using recursion
I have to write a recursive function that counts how many times a short array s2 is present in a bigger array s1 without overlapping. I'm allowed to use more than one function that can help me but they have to be all recursive function. For…

Dipok
- 181
- 9
1
vote
1 answer
count the number of occurrences when cells equal text
I have a matrix which encompasses values equal either to "J" or "N". These values appear in a block of 3, 2 or 1 and are separated by no values. I would like to count of many times a block of 3,2 and 1 appear. I could manage to do it when I replace…

richpiana
- 411
- 1
- 7
- 16
1
vote
1 answer
Hive SQL: How to find and flag occurrence within date range
I have a set of data below and I need to find and flag who has called back within 5 days based on phone number and call date as below. How do I do this in hive? Thank you for your help.
PhoneNumber CallDate Callback_Flag
5713555841 …

Mixer
- 183
- 2
- 7
- 15
1
vote
1 answer
SQL Extractvalue Xpath Expression find first occurence
I'm trying to extract the first occurrence in an xml message like this;
NVL(EXTRACTVALUE(message,'//ElementValue[1]'),NULL) as ElementValue
I get error:
XML - ORA-19025: EXTRACTVALUE returns value of only one node.
Any suggestions?

user6286511
- 11
- 2
1
vote
2 answers
Count characters and get percentage of occurrence in Php or SQL
I have a database with one table of two columns FirstName and LastName
and my names are Bruce Wayne, so what I want is an output that will give me this:
a 1 10%
B 1 10%
c 1 10%
e 2 20%
n 1 10%
r 1 10%
u 1 10%
W 1 10%
y 1 10%
How many times each…

Second Son
- 1,481
- 1
- 15
- 26
1
vote
2 answers
Counting records belonging to a category in MySQL
I've been battling with some SQL and can't seem to get my head around it.
I have two tables, one with the list of categories and another with all my articles.
What i'm trying to do is find how many articles are present for each category.
Here is the…

Stevanicus
- 7,561
- 9
- 49
- 70
1
vote
1 answer
emacs key bind search buffer to occur
I like the option to do C-s C-w and then show all in a separate buffer by using M-s o, but I would really like to keybind the M-s o ('occur) such that I can type C-s C-w C-, or similar-
I have tried the normal keybind:
(global-set-key (kbd "C-,")…

rasmus
- 125
- 2
- 3
- 11
1
vote
1 answer
Count the number of appeareances in a list, trick?
I have a matrix of 1 and 0. The rules concerning this table is as follows.
I would like to count the number of times a serie of 1,1 appears (where the 1 are not separated by 0!) and make the same thing for a serie of 1,1,1. I have tried colSums but…

richpiana
- 411
- 1
- 7
- 16
1
vote
1 answer
Return the number of times a value appears in a list in Erlang
I'm pretty new to Erlang. Here is a practice I've been working on but I cannot compile my code. The problem is to return the number of times a value appears in the list.
e.g.:
count(1, [2, 1, 2, 1, 2, 5]) ----> 2;
count(a, [a, b, c, d]) ---->…

rapsoulCecil
- 117
- 8
1
vote
3 answers
Removing duplicates based on their occurrence
I would like to check a certain column (W) for duplicates (number of occurrences is stored in another column (AZ)) and than delete all row this way:
Value is found two times in the column - delete only one row containing the value.
Value is found…

Gussmayer
- 13
- 3
1
vote
1 answer
Sort out the content displayed by the highest number
I have the following image: Please look at it for reference.
http://i58.tinypic.com/33219hh.png
Here is my code:
import xlrd,xlwt
def printDate(res):
for k,v in sorted(res.items(),key = lambda (k,v):(v,k),reverse= True):
…

krazzy
- 179
- 1
- 1
- 10
1
vote
4 answers
Print the count of every occurence of the text in each row and column from the dataset
I have the following image:
Please look at it for reference.
http://i58.tinypic.com/33219hh.png
What I am trying to get is for the code to read every value
in each column, and tell me how many times that "number" and
"letter" is there in the…

Jack
- 21
- 8