Create a frequency distribution table of class interval of size 5, containing upper limit, lower limit, frequency and middle values of limits using numpy and pandas libraries in python.
These are some steps/logics the were followed in the code (python programming language):
Create a list for lower limit, upper limit and frequency of the respective class intervals, name them ll, ul and freq respectively.
Now, create a 2D array consisting of lower limit, upper limit and the respective frequencies of the observations using numpy.
The middle value is the average of upper and lower limit.
Create a data frame which has upper limit, lower limit, frequency and middle value as the columns.
The data in the data frame represents the values i.e. the upper limit, frequencies, and middle values.
The frequency distribution table can be used for computation of the data such as finding mean, median and mode.
Lastly the mean of the data was found by taking the product of the corresponding frequency and middle value, summing them up and dividing it by the sum of frequencies.
Submitted by Ayush Chauhan (AyushChauhan07)
Download packets of source code on Coders Packet