Lab Assignment-1
Assignment-1- week 1 July
Learning Objective: Learn numpy, pandas ,matplotlib and seaborn
1. Learn creation and manipulation of NumPy arrays.
- Shape
- Size
- Number of dimensions
- Data type
2.NumPy Arithmetic and Indexing
Given
A =
[[10 20 30]
[40 50 60]
[70 80 90]]
B =
[[1 2 3]
[4 5 6]
[7 8 9]]
Perform
- Addition
- Subtraction
- Multiplication
- Division
- Square every element
- Extract second row
- Extract first and third columns
- Replace all values greater than 50 with 0.
3. Random Numbers and Statistics using NumPy
Problem
3x1-2x2+x3=3
x1+5x2+7x3=8
Generate marks of 100 students randomly between 35 and 100.
Find
- Mean
- Median
- Standard deviation
- Variance
- Highest mark
- Lowest mark
- Students scoring above 90
- Students scoring below average
Display the topper and bottom scorer.
4.Linear Algebra using NumPy
ProblemCreate two matrices
A (3×3)
B (3×3)
Perform
- Matrix addition
- Matrix multiplication
- Transpose
- Determinant
- Inverse
- Eigenvalues
- Eigenvectors
solve the following system of equations
2x1+3x2 +5x3= 103x1-2x2+x3=3
x1+5x2+7x3=8
5.Pandas Series and DataFrame
Problem
Problem
Consider sales data of an electronics shop.
Create a DataFrame for 15 students.
Columns
RollNo
Name
Marks
Perform
- Display first 5 rows.
- Display last 5 rows.
- Find average marks.
- Add Total.
- Add Percentage.
- Add Grade.
- Display students scoring above 85%.
- Sort according to percentage.
6.Data Cleaning using Pandas
ProblemCreate a CSV file containing
Name
Age
Department
Salary
Experience
Introduce
- Missing values
- Duplicate rows
- Incorrect values
Write a program to
- Read the CSV.
- Display information.
- Detect null values.
- Fill missing salary using average.
- Remove duplicates.
- Rename columns.
- Save cleaned data into another CSV.
7.Data Analysis using Pandas
Problem
Consider sales data of an electronics shop.
Columns
Date
Product
Category
Price
Quantity
City
Find
- Total sales.
- Highest selling product.
- City with highest sales.
- Average quantity sold.
- Total sales category-wise.
- Top five transactions.
- Monthly sales.
8.Matplotlib Visualization
ProblemUsing student marks dataset,
Draw
- Line chart
- Bar chart
- Pie chart
- Histogram
- Scatter plot
9.Plot the following functions
Write seperate functions for computing these functions
1.ReLU
2.Sigmoid
3.tanh
4.log
draw all these in a single plot. Use subplot.
10.Statistical Visualization using Seaborn
ProblemUsing the famous Iris dataset,
Create
- Scatter plot
- Pair plot
- Box plot
- Violin plot
- Histogram
- Heatmap of correlation matrix
Interpret
- Which feature separates species best?
- Which feature has highest correlation?
Comments
Post a Comment