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

NumPy assignment

The document outlines a series of programming assignments focused on NumPy and Matplotlib, including tasks related to array creation, statistical analysis, matrix operations, DataFrame manipulation, and data visualization. Specific tasks include generating random data, performing mathematical operations, creating plots, and analyzing employee salary data. The assignments aim to enhance skills in data manipulation and visualization using Python libraries.

Uploaded by

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

NumPy assignment

The document outlines a series of programming assignments focused on NumPy and Matplotlib, including tasks related to array creation, statistical analysis, matrix operations, DataFrame manipulation, and data visualization. Specific tasks include generating random data, performing mathematical operations, creating plots, and analyzing employee salary data. The assignments aim to enhance skills in data manipulation and visualization using Python libraries.

Uploaded by

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

Assingment8 Submitted by Nitin

NumPy-Based Questions

1. Array Creation and Manipulation:


o Create a NumPy array of random integers between 10 and 100 with shape (5,
5). Perform the following operations:
 Replace all even numbers with -1.
 Calculate the sum of each row and column.
 Normalize the array (scale values between 0 and 1).
2.Statistical Analysis:

o Generate a 1D NumPy array with 100 random floating-point numbers between


0 and 1.
o Find the mean, median, variance, and standard deviation of the array.
o Identify and replace any values below 0.2 with the mean value.
1. Matrix Operations:
o Create two 3x3 matrices using random integers and perform the following:
 Matrix addition, subtraction, and multiplication.
 Calculate the determinant and inverse of one of the matrices.
4. DataFrame Creation and Manipulation:
o Create a DataFrame with the following columns: Name, Age, Department, and
Salary for 10 employees.
 Add a new column for Bonus calculated as 10% of the Salary.
 Filter employees with a Salary greater than 50,000.
 Sort the DataFrame by Salary in descending order.
6.Grouping and Aggregation:

o Using the same employee dataset:


 Group employees by Department and calculate the average salary for
each department.
 Identify the department with the highest average salary.
 Plot the salary distribution of employees in different departments.

Matplotlib-Based Questions

7. Data Visualization:
o Create a line plot showing the growth of a company's revenue over the last 12
months.
 Add labels, title, and legend to the plot.
 Highlight the month with the maximum revenue using an annotation.

8. Bar Chart and Pie Chart:

o Using the employee dataset, create:


 A bar chart showing the number of employees in each department.
 A pie chart representing the percentage distribution of employees
across departments.
9.Histogram and Scatter Plot:

o Generate random data for students' test scores in two subjects (e.g., Math and
Science).
 Plot a histogram of scores for each subject.
 Create a scatter plot to analyze the correlation between Math and
Science scores. Add a trendline.
10. Weather Data Analysis:
o Generate a mock dataset for daily temperatures over a month using NumPy.
o Create a Pandas DataFrame with columns Day, Temperature, and Humidity.
o Perform the following:
 Identify the day with the highest temperature.
 Calculate the average temperature and humidity.

You might also like