GE Practical Sem 2
GE Practical Sem 2
a. Compute the mean, standard deviation, and variance of a two dimensional random integer array
along the second axis.
b. Create a 2-dimensional array of size m x n integer elements, also print the shape, type and data
type of the array and then reshape it into an n x m array, where n and m are user inputs given at the
run time.
c. Test whether the elements of a given 1D array are zero, non-zero and NaN. Record the indices of
these elements in seperate arrays.
d. Create three random arrays of the same size: Array1, Array2 and Array3. Subtract Array 2 from
Array3 and store in Array4, Create another array Array5 having two times the values in Array1. Find
Co- variance and Correlation of Array1 with Array4 and Array5 respectively.
e. Create two random arrays of the same size 10: Array1, and Array2. Find the sum of the first half of
both the arrays and product of the second half of both the arrays.
2. Do the following using PANDAS Series:
a. Create a series with 5 elements. Display the series sorted on index and also sorted on values
separately.
b. Create a series with N elements with some duplicate values. Find the minimum and maximum
ranks assigned to the values using 'first' and 'max' methods.
c. Display the index value of the minimum and maximum elements of a Series.
3. Create a data frame having at least 3 columns and 50 rows to store numeric data generated using a
random function. Replace 10% of the values by null values whose index positions are generated using
random function.
a. Identify and count missing values in a data frame.
a. Perform merging of the two data frames to find the names of student who had attended both
workshops.
b. Find names of all students who have attended a single workshop only.
c. Merge two data frames row-wise and find the total number of records in the data frame.
d. Merge two data frames row-wise and use two columns viz. names and dates as multi-row indexes.
Generate descriptive statistics for this hierarchical data frame.
5. Using iris data, plot the following with proper legend and axis labels: (Download IRIS data from:
https://archive.ics.uci.edu/ml/datasets/iris or import it from sklearn datasets)
a. Plot bar chart to show the frequency of each class label in the data.
b. Draw a scatter plot for Petal width vs sepal width and fit a regression line.
c. Plot density distribution for feature petal length.
d. Use a pair plot to show pairwise bivariate distribution in the Iris Dataset.
e. Draw heatmap for the four numeric attributes
f. Compute mean, mode, median, standard deviation, confidence interval and standard error for each
feature.
g. Compute correlation coefficients between each pair of features and plot heatmap.
6. Consider the following data frame containing a family name, gender of the family member and
her/his monthly income in each record.
b. Calculate and display the member with the highest monthly income.
c. Calculate and display monthly income of all members with income greater than Rs 60000.00.
d. Calculate and display the average monthly income of the female members.
7. Using Titanic dataset, to do the following: