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
0 answers

Calculate frequency and percentage within a subgroup in R

I have a data frame called measlescases comprised of columns like "Final Classification' 'ProvinceofResidence', 'AgeCategory', 'Vaccinationstatus', etc. I would like to calculate the number of measles cases (obtained from the 'Final Classification'…
ChinweJaja
  • 11
  • 2
1
vote
0 answers

How can you calculate the frequencies of elements across multiple columns?

I was wondering about the most efficient way to calculate the frequencies of repeated values across multiple columns. In the code example below, I want to calculate the total number of times each unique value (1, 2, or 3) appears across the 3…
kthomas
  • 11
  • 2
1
vote
1 answer

Frequency Distribution of Bigrams

I have done the following import nltk words = nltk.corpus.brown.words() freq = nltk.FreqDist(words) And am able to find the frequency of certain words in the brown corpus, like freq["the"] 62713 But now I want to be able to find the Frequency…
Eddie14
  • 19
  • 5
1
vote
1 answer

Making freq distribution from dataframe

I'm trying to make a frequency distribution of grades (1:10) as well as its cum frequency. the letter a, b, c, d, ... represents students and C1:C6 represents Course 1 till 6. Could you advise how to create frequence distribution of grades and plot…
1
vote
4 answers

Calculate mean and median for a frequency table per column (length class per group)

I have a frequency table of length classes of fish per location: LK Loc1 Loc2 Loc3 1 13 22 0 2 20 18 4 3 12 21 2 4 2 0 1 5 1 2 0 I would…
Suusie
  • 149
  • 9
1
vote
4 answers

Frequency Distribution Histogram with Bins with Two Variables on the Y-axis in R

I was given this dataframe, which is at the same time a frequency distribution, and was given a task of plotting a histogram of the age distribution of the whole population adding to the plot the male and female profile. What I need to achieve is a…
Ema Ilic
  • 11
  • 2
1
vote
1 answer

Parsing Nested Row Text Document for Frequency Distribution Plot with Python

I have a document with the following structure: CUSTOMERID1 conversation-id-123 conversation-id-123 conversation-id-123 CUSTOMERID2 conversation-id-456 conversation-id-789 I'd like to parse the document to get a frequency…
coco
  • 41
  • 3
1
vote
1 answer

How to create a Frequency Distribution Matrix from a Pandas DataFrame of boolian values

In short, I'm trying to translate a DataFrame like this Patient Cough Headache Dizzy 1 1 0 0 2 1 1 1 3 0 1 0 4 1 0 1 5 0 1 …
1
vote
1 answer

Why is inline FreqDist failing?

I wrote a simple function. def common_long_words(text): sorted(w for w in set(text) if len(w) > 7 and (FreqDist(text))[w] > 7) This is stuck. Also, [w for w in set(text5) if len(w) > 7 and FreqDist(text5)[w] > 7 fails. It just get…
Anubhav
  • 173
  • 2
  • 7
1
vote
2 answers

Count total number of words in a corpus using NLTK's Conditional Frequency Distribution in Python (newbie)

I need to count the number of words (word appearances) in some corpus using NLTK package. Here is my corpus: corpus = PlaintextCorpusReader('C:\DeCorpus', '.*') Here is how I try to get the total number of words for each document: cfd_appr =…
Gavrk
  • 295
  • 1
  • 4
  • 16
1
vote
1 answer

is there a method to get frequency distribution different columns in R

The data are: df1<-read.table(text=" Car1 Car2 Car3 Group1 Group2 Group3 Code1 Code2 Code3 N M M A A A B B B Q M M B B A A A B Q N Q A A B A B B N P P A A A A B A N M Q A B A B A A M Q P B A A B B A N M N B A A A B A N N M B B B A B A Q…
user10072460
1
vote
0 answers

How to tabulate Conditional Frequency Distribution for collocations in texts

I have several texts that I found collocations for, and now I'd like to create a table that shows how many times each collocation appears in each text of the corpus. When I generate a table or a plot from the ConditionalFreqDist,it shows only 1…
Gavrk
  • 295
  • 1
  • 4
  • 16
1
vote
2 answers

Grouping by week and ID, averaging, Grouping by week again and plotting

I have a panda Data-Frame of tweets called "labelled_data" which includes 'tweep_username', 'tweetcreated_at'(which is time) and 'label' I wanna group them by 'tweep_username' and 'tweetcreated_at'(by week) and then take mean of 'labels'. Then I…
1
vote
0 answers

Python random frequency

This code returns a number between 0 and 2: from random import randint a = randint(0, 2) print(a) Each "option" has 33.3% frequency. This code return a number between 0 and 2, too, but the "options" has following…
1
vote
2 answers

Making two seaborn countplots that share the same axis

I'm looking to use seaborn countplots to display the frequency distribution of two different lists of data on one axis. The problem I'm having is that both lists contain unique elements, so I can't simply plot one list using the axis of the larger…
user3163789
  • 63
  • 2
  • 6