0% found this document useful (0 votes)
11 views

5thSem_assignment_python_2024

Uploaded by

sagniksudip1971
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

5thSem_assignment_python_2024

Uploaded by

sagniksudip1971
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Write a python program

1. to check whether the number is palindrome or not.


2. to reverse the given list without using respective function related to list.
3. to sort a given list of numbers in the ascending order.
4. to slice the following list into 3 equal chunks and reverse each chunk using indexing,
[17, 49, 8, 67, 15, 91, 88, 55, 84]
5. to find all the possible subsets of the set {7,8,9}.
6. to display all the distinct subsets of a set of numbers representing by the tuple containing
(2,4,6,8).
7. to Display all the pair elements of the Cartesian product of two sets represented by A=(1,2,3) and
B=(‘a’, ‘b’, ‘c’)
8. to merge two given set of numbers in sorted form.
9. to create a dictionary cotaining following key:value pairs
Key:- 1 3 2 4
Value:- ”Howrah” “Dumdum” “Bally” “Jadavpur”
a) modify the value of key ‘3’ as “Dakshineswar”
b) sort the dictionary depending on keys
c) display all the values in sorted form
10. to create nested dictionary to store student records with their roll, name, age and class, where
name has two attributes named as first name and surname.Take minimum three records and
display them according to the roll number.

11. to make an nd array and find out the followings


i) shape of the array.
ii) total no of dimensions of the array.
iii) find out type of elements.
iv) length of the element.
12. to create an array of ten 0’s , ten 1’s and ten 2’s with shape(10,3). Then print it with the shape
(3,5,2).
13. to find unique elements and number of occurences of those elemnts in an array.
14. to print the columns individually of a 2-D array.
15. to generate n*m array of random numbers in the range [0-1]. Here consider the values upto 2-
decimal places. Convert it into boolean array, depending on element in array > 0.45 .

16. to find the sum of two matrices, and also their product.
17. to create an array with some null values. Find the total number of null values and also their
positions.
18. to display distinctly the curve and scatter plots of the function y= x2 + 2x -3.
19. to draw a pie chart represents the percentage of productions by 4 machines, where machines A,
B, C and D produces respectively 35%, 25%, 15% and 25% of total productions.

20. to store records of server_utilities.csv in a dataframe.


a) sort records depending on datetime
b) print the minimum and maximum server_id.
c) sort records on server_id
b) find the mean of cpu_utilization

21. to convert given Pandas series into a dataframe with its index as another column on the
dataframe.
22. to replace values of a DataFrame with the values of another DataFrame in Pandas.

You might also like