Assignment - 1 (IDSUP) - Omkar
Assignment - 1 (IDSUP) - Omkar
1. An anonymous dataset containing each user’s salary (in dollars) and tenure as a data scientist (in
years) is given.
2. For the above data there seems to be a correspondence between years of experience and paid accounts
Users with very few and very many years of experience tend to pay; users with average amounts of
experience don’t. Find out the condition for this correspondence and print it.
1
Centre for Data Science
Institute of Technical Education & Research, SOA, Deemed to be University
2
Centre for Data Science
Institute of Technical Education & Research, SOA, Deemed to be University
4. Write a Python Script to generate random passwords (alphanumeric). Ask users to enter the length of
password and number of passwords they want to generate and then print all the generated passwords.
5. What is Type Annotations? What are the uses of this in any python program? How to write this, give
one example.
3
Centre for Data Science
Institute of Technical Education & Research, SOA, Deemed to be University
6. Read a lists named StringList1 containing strings from the key board. Generate a string MStringList1
that contains all items of StringList1 that are repeated twice or more number of times and print this
list. By observing the outcome of MStringList1 perform the following tasks:
a. Check weather an item of MStringList1 occurs even number of times or odd number of times
in StringList1.
b. Remove the ith (i ≥ 2) occurrence of a given word in a StringList1.
4
Centre for Data Science
Institute of Technical Education & Research, SOA, Deemed to be University
7. Count frequencies of various alphabets (Convert upper case into lower case and input given by user),
plot the results for this as a bar chart with x-axis being the letter and y-axis as the corresponding
frequency.
5
Centre for Data Science
Institute of Technical Education & Research, SOA, Deemed to be University
8. Use the following data to plot the number of applicant per year as a scatter plot.
year = [2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012]
no application per year = [921261, 929198, 1043739, 1186454,
1194938, 1304495, 1356805, 1282000, 479651]
6
Centre for Data Science
Institute of Technical Education & Research, SOA, Deemed to be University
9. Plot xsinx, x2sinx , x3sinx and x4sinx in a single plot in the range x ∈ [−10, 10].
7
Centre for Data Science
Institute of Technical Education & Research, SOA, Deemed to be University
10. Plot histogram for age of male and female in different plots for the following data of male and female
age.
8
Centre for Data Science
Institute of Technical Education & Research, SOA, Deemed to be University
11. Plot the temperature extremes in certain region of India for each month, starting in January, which are
given by (in degrees Celsius).
max: 17, 19, 21, 28, 33, 38, 37, 37, 31, 23, 19, 18
min: -62, -59, -56, -46, -32, -18, -9, -13, -25, -46, -52, -58
9
Centre for Data Science
Institute of Technical Education & Research, SOA, Deemed to be University
12. Python Program to find all Numbers in a Range (given by user) which are Perfect Squares and Sum
of all Digits in the Number is Less than 10.
1
0
Centre for Data Science
Institute of Technical Education & Research, SOA, Deemed to be University
13. Plot a bar chart with axis labels for given data:
1
1
Centre for Data Science
Institute of Technical Education & Research, SOA, Deemed to be University
14. Plot the scatter plot for following data with unequal axis and then equal axis. Also state the difference
in two.
1
2
Centre for Data Science
Institute of Technical Education & Research, SOA, Deemed to be University
1
3