Data Science Lab QP
Data Science Lab QP
1. a. Write a NumPy program to create a null vector of size 10 and update sixth value to 11
b. Write a NumPy program to convert an array to a float type
c. Write a NumPy program to create a 3x3 matrix with values ranging from 2 to 10
d. Write a NumPy program to convert a list of numeric value into a one-
dimensional NumPy array
3. Write a Pandas program to get the powers of an array values element wise. Note: First
array elements raised to powers from second array
Expected Output:
XYZ
0 78 84 86
1 85 94 97
2 96 89 96
3 80 83 72
4 86 86 83
5. Write a Pandas program to count the number of rows and columns of a DataFrame. Sample
Python dictionary data and list labels:
6. Reading data from text files, Excel and the web and exploring various commands for
doing descriptive analytics on the Iris data set
7. Use the diabetes data set from Pima Indians Diabetes data set for performing the
following: Apply Univariate analysis:
Frequency
Mean,
Median,
Mode,
Variance
Standard Deviation
Skewness and Kurtosis
8. Use the diabetes data set from Pima Indians Diabetes data set for performing the
following:
9. Use the diabetes data set from Pima Indians Diabetes data set for performing the
following:
Apply Bivariate analysis:
Multiple Regression analysis
10. Apply and explore various plotting functions on UCI data set for performing the
following:
a) Normal values
b) Density and contour plots
c) Three-dimensional plotting
11. Apply and explore various plotting functions on UCI data set for performing the
following:
12. Apply and explore various plotting functions on Pima Indians Diabetes data set for
performing the following:
a) Normal values
b) Density and contour plots
c) Three-dimensional plotting
13. Apply and explore various plotting functions on Pima Indians Diabetes data set for
performing the following:
a) Correlation and scatter plots
b) Histograms
c) Three-dimensional plotting
15. Write a Pandas program to group by the first column and get second column as
lists in rows Sample data:
Original DataFrame col1 col2
0 C1 1
1 C1 2
2 C2 3
3 C2 3
4 C2 4
5 C3 6
6 C2 5
Group on the col1: col1
C1 [1, 2]
C2 [3, 3, 4, 5]
C3 [6] Name: col2, dtype: object
17. Write a NumPy program to merge three given NumPy arrays of same shape
SET2
2) i. Write a NumPy program to find the real and imaginary parts of an array of complex
numbers
ii. Write a NumPy program to convert a NumPy array into a csv file
4) i. Use NumPy, Create an array with 5 dimensions and verify that it has 5 dimensions
ii. Using NumPy, Sort a boolean array
5) i. Create your own simple Pandas DataFrame and print its values
ii. Create your own DataFrame from dict of narray/list
6) Perform appending, slicing, addition and deletion of rows with a Pandas DataFrame.
7) i. Using Pandas, Create a DataFrame with a list of dictionaries, row indices, and
column indices.
ii. Use index label to delete or drop rows from a PandasDataFrame.
10) Use the diabetes data set from UCI, Perform Univariate analysis
13) Use the diabetes data set from Pima Indians Diabetes, Perform Bivariate analysis
14) i. Using various functions in numpy library, mathematically calculate the values for a
normal distribution and create Histograms to plot the probability distribution curve.
ii. Using plt.contour(), plt.contourf(), plt.imshow(), plt.colorbar(), plt.clabel() functions
visualize a contour plot
15) How will you plot and visualize geographical data with the help of Basemap. State the
Procedure for it with an example.
16) Perform Reading data from text files, Excel and the web and exploring various
commands for doing descriptive analytics on the Iris data set