0% found this document useful (0 votes)
5 views2 pages

Test 11

The document contains a revision worksheet with multiple-choice questions related to data analysis and programming in Python, specifically focusing on libraries like NumPy and Pandas. It includes questions on correlation, regression, data manipulation, and visualization techniques. Additionally, it provides tasks for coding exercises and calculations involving data structures and statistical concepts.

Uploaded by

anjalisharma
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)
5 views2 pages

Test 11

The document contains a revision worksheet with multiple-choice questions related to data analysis and programming in Python, specifically focusing on libraries like NumPy and Pandas. It includes questions on correlation, regression, data manipulation, and visualization techniques. Additionally, it provides tasks for coding exercises and calculations involving data structures and statistical concepts.

Uploaded by

anjalisharma
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/ 2

Revision Worksheet

Q-1 Multiple Choice Questions:


1. Which of the following are the types of correlation?
a. Positive correlation b. Negative Correlation
c. No correlation d. All of the above
2.The slope of the regression line of Y on X is also referred to as the:
a. Regression coefficient of X on Y
b. The correlation coefficient of X on Y
c. Regression coefficient of Y on X
d. Correlation coefficient of Y on X.
3. What is the primary data structure used in NumPy to represent arrays of any dimension?
a) Series b) DataFrame
c) ndarray d) Panel
4. Which of the following Python statements is used to export a Pandas DataFrame df to a
CSV file named output.csv?
a)df.save_csv ('output.csv')
b) df.to_csv ('output.csv')
c) pd.export_csv (df, 'output.csv')
d) df.write_csv ('output.csv')
5.What is the purpose of the head() method in Pandas?
a) To display the first few rows of a DataFrame.
b) To display the last few rows of a DataFrame.
c) To count the number of rows in a DataFrame.
d) To perform aggregation operations on a DataFrame.
6. Which method allows you to delete rows from a DataFrame?
a)remove() b)drop()
c)delete() d)pop()
7. ________________provides a selection of efficient tools for machine learning and statistical
modeling via a consistent interface in Python.
a)Numpy b) Python
c) Scikit Learn d)Pandas
8. To append to a CSV file,open the file in _____________ mode.
a) ‘w’ b) ‘a’
c) ‘r’ d) can’t append
9. Which function is used to set the size of the plot in Matplotlib?
a. title()
b. xlabel()
c. figure()
d. show()
10. Which of the following Python statements can be used to select a column
column_name from a DataFrame df ?
a. df.getcolumn('column_name')
b. df['column_name']
c. df.select('column_name')
d. df(column_name)
11. What is the shape of a 1D NumPy array with 5 elements?
a.(1,5) b. (5,)
c. (5,1) d. (1,)
12.
Which of the following Python statements is used to import data from a CSV file
into a Pandas DataFrame?
a) pd.open_csv('filename.csv')
b)pd.read_csv('filename.csv')
c)pd.load_csv('filename.csv')
d)pd.import_csv('filename.csv')
Q-2 Athrav is confused about the different libraries of Python. Help him choose the correct
library for the following tasks.
a. Data manipulation and aggregation functionalities
b. Numerical computing
c. Mathematical operations like square root, cosine values
d. Machine learning and statistical modeling
Q-3 Study the following information, calculate coefficient of correlation using formula:
 Covariance Cov(X,Y)=−15.2,
 Standard deviation of X =5.2
 Standard deviation of Y =3.3

Q-4 Consider the DataFrame shown below:

I. Print the first three rows of the DataFrame df.


II. Display Class of all the Names.
III. Remove the column Marks.
IV. Rename the column name 'Class' to 'Grade'.
Q-5 Write a program to plot the line chart with the following functionality
1. Marker should be as ‘o’
2. Line color should be blue
3. Width of line should be 10
A=[10,11,12,33,24,45,66,17]
B= [40,12,45,78,80,35,64,79]
Q-6 Write a program to create series from an array in Python.
Q-7 Athrav is confused about the different libraries of Python. Help him choose the correct
library for the following tasks.
a. Data manipulation and aggregation functionalities
b. Numerical computing
c. Mathematical operations like square root, cosine values
d. Machine learning and statistical modeling.

You might also like