Questions tagged [cumulative-frequency]
76 questions
34
votes
1 answer
Plot with fewer markers than data points (or a better way to plot CDFs?) [matplotlib, or general plotting help]
I am plotting Cumulative Distribution Functions, with a large number of data points. I am plotting a few lines on the same plot, which are identified with markers as it will be printed in black and white. What I would like are markers evenly spaced…
![](../../users/profiles/59334.webp)
James Broadhead
- 1,728
- 1
- 14
- 19
32
votes
5 answers
How to generate a frequency table in R with with cumulative frequency and relative frequency
I'm new with R. I need to generate a simple Frequency Table (as in books) with cumulative frequency and relative frequency.
So I want to generate from some simple data like
> x
[1] 17 17 17 17 17 17 17 17 16 16 16 16 16 18 18 18 10 12 17 17 17 17…
![](../../users/profiles/337772.webp)
eloyesp
- 2,653
- 1
- 26
- 41
11
votes
1 answer
Tricks to get reverse-order cumulative histogram in matplotlib
I am wondering if there is a (better) trick to reverse a cumulative histogram in matplotlib.
Let's say I have some scores in the range of 0.0 to 1.0 where 1.0 is the best score. Now, I am interested to plot how many samples are above a certain score…
user2489252
6
votes
1 answer
How to implement a cumulative product table?
Given the following problem:
There is a sequence of k integers, named s for which there can be 2 operations,
1) Sum[i,j] -
What is the value of s[i]+s[i+1]+...+s[j]?
2) Update[i,val] -
Change the value of s[i] to val.
I am sure most people here…
![](../../users/profiles/2349125.webp)
Donald
- 1,180
- 2
- 10
- 27
5
votes
3 answers
Mysql calculation in select statement
I have been doing my office work in Excel.and my records have become too much and want to use mysql.i have a view from db it has the columns "date,stockdelivered,sales" i want to add another calculated field know as "stock balance".
i know this is…
![](../../users/profiles/2264833.webp)
Law
- 109
- 1
- 3
- 10
5
votes
2 answers
efficiently replacing data frame with cumulative frequency
I'm trying to write a program that takes a large data frame and replaces each column of values by the cumulative frequency of those values (sorted ascending). For instance, if the column of values are: 5, 8, 3, 5, 4, 3, 8, 5, 5, 1. Then the relative…
![](../../users/profiles/1769120.webp)
user1769120
- 97
- 7
4
votes
2 answers
Fast counts of elements of numpy array by value thresholds in another array
Given a numpy array of threshold values, what is the most efficient way to produce an array of the counts of another array meeting these values?
Assume the threshold value array is small and sorted, and the array of values to be counted is…
![](../../users/profiles/2573061.webp)
C8H10N4O2
- 15,256
- 6
- 74
- 113
4
votes
1 answer
Cumulative count of unique values per group
I have a df with names and some dates of eligibility status. I would like to create an indicator of how many unique elig_end_dates a person has, according to time. here is my df:
names date_of_claim elig_end_date
1 tom 2010-01-01 …
![](../../users/profiles/2363642.webp)
user2363642
- 707
- 8
- 25
4
votes
6 answers
SQL query for cumulative frequency of list of datetimes
I have a list of times in a database column (representing visits to a website).
I need to group them in intervals and then get a 'cumulative frequency' table of those dates.
For instance I might have:
9:01
9:04
9:11
9:13
9:22
9:24
9:28
and i want…
![](../../users/profiles/24727.webp)
Simon
- 523
- 1
- 14
- 21
3
votes
2 answers
SQL query - find row which exceeds cumulative proportion
Say I have a table of data that looks like:
ItemNo | ItemCount | Proportion
------------------------------------------
1 3 0.15
2 2 0.10
3 3 0.15
4 …
![](../../users/profiles/694652.webp)
Widor
- 12,075
- 6
- 35
- 60
3
votes
1 answer
Draw nearest value from sorted data frame into unsorted data frame
I have two data frames in R. The first data frame is a cumulative frequency distribution (cumFreqDist) with associated periods. The first rows of the data frame look like this:
Time cumfreq
0 0.0000000
4 0.9009009
6 …
![](../../users/profiles/1030648.webp)
Michelle
- 1,225
- 2
- 16
- 27
2
votes
1 answer
Changing the relative height of the bins of a histogram interactively
In subjective probability assessments one needs to elicit the distribution of subjects believes. It can be achieved by letting the subject manipulate the relative height of each frequency bin of a histogram. I.e. the distribution of probability, the…
![](../../users/profiles/345913.webp)
Roland Kofler
- 1,282
- 1
- 14
- 33
2
votes
0 answers
Error in lines.etm(x[[i]], tr.choice = tr.choice[j], col = col[j + (i - : Argument 'tr.choice' and possible transitions must match
When trying to plot cif data in R :
plot(cif.kweet) this error pops up:
"Error in lines.etm(x[[i]], tr.choice = tr.choice[j], col = col[j + (i - :
Argument 'tr.choice' and possible transitions must match", what does this mean, how to solve…
![](../../users/profiles/8915789.webp)
Kweetvannix
- 51
- 9
2
votes
3 answers
Counting frequencies of the corresponding values in pandas [python 3]
I have the dataset with the following values:
var1 var2
1234 abc
2345 bcs
5678 csd
1234 abc
1234 bcs
5678 csd
1234 bcs
1234 xyz
1234 abc
9101 zzz
I need for every unique value in column var1 to count and show the top 3 frequency counts…
![](../../users/profiles/1907382.webp)
Feyzi Bagirov
- 1,040
- 3
- 18
- 34
2
votes
3 answers
Cumulative count of blocks of 1 with 0 separators in a binary vector in R
I have a data frame with a binary vector that I want to do a cumulative count of. However I would like to count the 'groups of 1's' rather than each individual 1 and create a new vector of this count while retaining the 0 separating values.
i.e.…
![](../../users/profiles/1517860.webp)
Jojo
- 3,923
- 7
- 19
- 27