Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
5 views

Python lab programs

The document outlines various programming tasks involving data manipulation and statistical analysis using Python libraries such as NumPy and Pandas. It includes operations on number and string lists, matrix operations, statistical distributions, and data visualization with Matplotlib. Additionally, it covers database creation and record management using MongoDB.

Uploaded by

midhunmidhu1882
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Python lab programs

The document outlines various programming tasks involving data manipulation and statistical analysis using Python libraries such as NumPy and Pandas. It includes operations on number and string lists, matrix operations, statistical distributions, and data visualization with Matplotlib. Additionally, it covers database creation and record management using MongoDB.

Uploaded by

midhunmidhu1882
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

PART A

1. Perform the following operations on number list:


a) Sum
b) Average
c) Max
d) Min
e) Sort
f) Reverse

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.

You might also like