/PythonConsole

Small programs developed in python

Primary LanguagePythonOtherNOASSERTION

PythonConsole

Small programs developed in python

1.Number of Vaccinations

We have a report on the number of flu vaccinations in a class of
20 people.

It has the following numbers:
never: 5
once: 8
twice: 4
3 times: 3

What is the mean number of times those people have been vaccinated?
Output the result using the print() statement.

2.Number of Vaccinations 2nd

Using the same vaccinations dataset, which includes the number of times people got the flu vaccine.
The dataset contains the following numbers:
never: 5
once: 8
twice: 4
3 times: 3

Calculate and output the variance.
Declare a list with the data and use a loop to calculate the value.
We will soon learn about easier ways to calculate the variance 
and other summary statistics using Python. 
For now, use Python code to calculate the result using the corresponding equation.

3.Square Footage

You are given an array that holds the square footage data for houses on a particular street. A new house has just been constructed on that street.

Modify your program to take the new house value as 
input, add it to the array, and output the array 
sorted in ascending order.

4.Seats in a Theater

You are given an array that represents the occupancy of seats in a movie theater. A seat marked with 1 is occupied, while one marked 0 means the seat is free. However, the array is flat and 1-dimensional.

Transform it into a 2-dimensional array, representing the rows of the seats.
Each row in the theater has 5 seats and there are a total of 30 seats.
Reshape the array into the corresponding shape and output 
the row at the given index, which is taken from user input.

5.Multiples of 3 and 5

You are given a task to find all of the whole numbers below 100 that are multiples of both 3 and 5.

Create an array of numbers below 100 that are multiples of both 3 and 5, and output it

6.Daily Infections

The given array represents the daily number of infections for 30 days.

Find out how many days exceeded the average number of infections.

7.Locating Contacts

You are given a dictionary that contains names and numbers of people.

You need to create a DataFrame from the dictionary and
add an index to it, which should be the name values.
Then take a name from user input and output the row in
the DataFrame, which corresponds to that row.

8.Ranking Board

You are given a DataFrame that includes the names and ranks of people.

You need to take a rank as input and output the corresponding name column from the DataFrame as a Series.