Module 7 _ Advanced Python Tools Assignment DS
Module 7 _ Advanced Python Tools Assignment DS
Instructions
Step 2 Create a new Python script numpy_assignment.ipynb. Import NumPy and follow
these steps:
1. Create a 1D NumPy array with integers from 1 to 20. Perform the following
operations:
a. Calculate the sum, mean, median, and standard deviation of the elements in the
array.
b. Find the indices of elements greater than 10 in the array.
3. Create two 3 X 3 arrays filled with random integers between 1 and 20.
a. Perform element-wise addition, subtraction, and multiplication.
b. Compute the dot product of the two arrays.
4. Reshape a 1D array of size 12 into a 3 X 4 2D array and slice the first two rows
and last two columns.
Instructions
Step 2 Create a new Python script pandas_assignment.ipynb. Import Pandas and follow
these steps:
4. Group the data by 'Department' and calculate the average salary for each
department.
5. Sort the DataFrame by 'Salary' in ascending order and save the result to a new CSV
file.
Instructions
x = [1, 2, 3, 4, 5]
y = [10, 15, 25, 30, 50]
Note: For each assignment, provide explanations in markdown cells describing the steps
and purpose of each part of the code. Submit the assignments as .ipynb files with
visualization outputs.