Question: Write python code for the following: Following table represents the frequency of the weights of 25 students in a team: - Weight (lbs) Number of
Write python code for the following:
Following table represents the frequency of the weights of 25 students in a team: -
| Weight (lbs) | Number of students |
| 88 | 4 |
| 76 | 3 |
| 65 | 5 |
| 96 | 2 |
| 52 | 5 |
| 98 | 2 |
| 102 | 4 |
1. For the data given above, write a Python program to create a dictionary, which maps the values to their frequencies and calculates the probability of each weight using their frequencies.
2. . Write a Python program using only numpy functions that creates a matrix of 3 columns and 8 rows with sequential integers from 0-23.
3. Write a stochastic program in Python to replicate a fair dice (one dice) roll, such that this one dice is rolled 100 times. Display the output of the dice rolls as a histogram.
4. Write a python program that connects to the MySQL database, which has the three tables from the world.sql script. Display the bar chart of the top 20 countries by GNP
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
