Questions tagged [frequency-distribution]

A frequency distribution is an arrangement of the values that one or more variables take in a sample

A frequency distribution is an arrangement of the values that one or more variables take in a sample. Each entry in the table contains the frequency or count of the occurrences of values within a particular group or interval, and in this way, the table summarizes the distribution of values in the sample.

220 questions
1
vote
1 answer

python for loop performance

`Improve performance in python 'for' loop: I need to know How can i decide whether my loop is efficient or not? If it iterates over X number of loops, what should be the acceptable time taken? I was trying to make a function to create a frequency…
1
vote
1 answer

Arules Package: Discretize a continuous vector into a discrete vector with specific categories to produce a table of frequencies in R

Overview I have a continuous vector called "Canopy_Index" and another vector called "Species", which is a factor. My aim is to discretize the Canopy_Index vector using the R-code below into a discrete vector containing specific percentage…
1
vote
1 answer

using jq to output in tsv unique values of an element with frequency of occurrence

given the following json, how could i create a tsv, that would output the frequencies of the values found in it (in the new element)? {"_id":{"$someid":"545"},"new":"813 ROT","old":{"$someid":"5fe"}} {"_id":{"$someid":"659889a"},"new":"9878…
user10628665
1
vote
1 answer

How to construct a table of frequency counts of items in a pandas dataframe?

Say I have the following data in a csv file, example.csv: Word Score Dog 1 Bird 2 Cat 3 Dog 2 Dog 3 Dog 1 Bird 3 Cat 1 Bird 1 Cat 3 I want to count the frequency of each word for each score. The expected…
Kristada673
  • 3,512
  • 6
  • 39
  • 93
1
vote
0 answers

Creating a normal distribution curve over a frequency histogram

I have generated 10000 normally distributed random test scores as a percentage. This data is represented in a histogram that measures score percentage in the x-axis, and score frequency in the y-axis. I want to create a normal distribution curve…
1
vote
1 answer

R: extract sequence of frequencies (contingency tables) from increasing parts of a vector

I have a vector V with n elements, each element can be an integer between 1 and N. Given this vector I'd like to construct an N×n matrix W in which column i contains the frequencies of the integers between 1 and N as they appear in the subvector…
pglpm
  • 516
  • 4
  • 14
1
vote
4 answers

Counting subsequent letters

So I am trying to implement code that will count the next letter in a sentence, using python. so for instance, """So I am trying to implement code that will count the next letter in a sentence, using python""" most common letters one after the…
1
vote
2 answers

Frequency table for a random subset in R

Suppose I have a frequency chart of the ten most popular names of babies born in the US in 2006: myfreq <- c(24835, 22630, 22313, 21398, 20504, 20326, 20054, 19711, 19672, 19400) names(myfreq) <- c("Jacob", "Michael", "Joshua", "Emily", "Ethan",…
Montgomery Clift
  • 445
  • 3
  • 13
1
vote
1 answer

How can I plot the mean of sliding groups of data in R?

I have a frequency distribution I am trying to plot in R. The dataset is quite noisy however and results in an untidy plot. I would like to take the mean of 10 unit sliding windows and plot that data instead. Hopefully this will clean up the plot,…
gawbul
  • 1,207
  • 12
  • 20
1
vote
0 answers

Representing index rows as a range of values in 'pivot_table' of 'python pandas'

example data: exdata = {'year':[1 ,2 ,5 ,7 ,2 ,3 ,2 ,4 ,8 ,9], 'price':[120 ,99 ,55 ,23 ,87 ,31 ,149 ,45 ,32 ,55], 'dist':[999 ,3741 ,8893 ,5321 ,1987 ,9299 ,573 ,4732 ,4536 ,4032], 'loca':['a' ,'b' ,'a' ,'c' ,'d' ,'d' ,'a'…
Cho
  • 163
  • 3
  • 13
1
vote
1 answer

R get frequency distribution by a categorical or factor column

I have a data like below. If I want to find frequency distribution then I can use hist command as below and using histz$breaks and histz$counts find number of observations that fall within each range. I would like to get distribution of column b by…
user2543622
  • 5,760
  • 25
  • 91
  • 159
1
vote
0 answers

Fitting Scipy Betaprime distribution function on a histogram

I have a histogram of 2782 rows of records. I would like to fit a Betaprime distribution function with these following parameters: a = 1.95 b = 4.58 location = 2.28 scale = 411.99 However with the below code, my histogram graph shows a flat "blue"…
Dinesh
  • 654
  • 2
  • 9
  • 31
1
vote
0 answers

Comparison of mixture distribution models (computed in mixdist; R) using AIC

I am using the mixdist package to model length-frequency data into separate cohorts very similar to the method posted here (specifically the function mix()). Currently I have been looking at the size frequency histograms of my original data,…
1
vote
2 answers

frequency distribution of vectors

I have a list of vectors in R (permutations of {1,2,3}) like this: > Ls $L [,1] [,2] [,3] [1,] 1 2 3 $L [,1] [,2] [,3] [1,] 1 2 3 $L [,1] [,2] [,3] [1,] 2 1 3 I would like to have a frequency…
massimo
  • 11
  • 2
1
vote
1 answer

How do I generate random vectors from a bar graph of probabilities?

I have generated a bar graph that counts the number of 1's in each bit of a 16-digit binary string: I would like to generate 300 binary vectors of 16 bits that roughly follows the above distribution. Initially, my code depended on a probability…
Jack D.
  • 41
  • 5