Python lab programs
Python lab programs
Output:
2. Perform the following operations on string list:
a) Swap elements of string list
b) Combining two list
Output:
3. Perform matrix operations using NumPy
Output:
4. Write a python program to find tuples which have all elements divisible by k
from a list of tuples
Output:
5. Write a python program for removing duplicates from tuples
Output:
6. Perform the following operations using NumPy:
a) Joining two arrays
b) Splitting arrays
c) Searching element
d) Sorting
e) Filtering
Output:
7. Pandas with experiment
Create excel table of students using pandas having
1) USN
2) Name
3) M1
4) M2
5) M3
Calculate total and average and display result in table format
marks.xlsx
PART B
1. Write program for following:
a) Normal distribution
b) Binomial distribution
c) Poisson distribution
d) Uniform distribution
e) Logistic distribution
2. Calculate the following
a) Mean
b) Median
c) Mode
d) Standard Deviation
e) Percentile
import numpy as np
from scipy import stats
data = [1,2,3,4,5,6,7,8,9,10,11,12]
mean = np.mean(data)
median = np.median(data)
mode = stats.mode(data)
std_dev = np.std(data)
percentile_50 = np.percentile(data, 50)
print("Mean:", mean)
print("Median:", median)
print("Mode:", mode)
print("Standard Deviation:", std_dev)
print("50th Percentile (Median):", percentile_50)
3. Calculate
a) Linear Regression
b) Polynomial Regression
a) Linear Regression
b) Polynomial Regression
4. Draw following diagram using Matplotlib
a) Line
b) Grid
c) Bars
d) Pie Chart
5. Create a database using MongoDB.
Insert the records and display the records.