Python for Data Science PART 1
Python for Data Science PART 1
Question 1:
Which library is commonly used for data manipulation and analysis in
Python?
A) NumPy
AM
B) Matplotlib
C) Pandas
D) Scikit-Learn
AY
Accepted Answer: C) Pandas
Question 2:
SW
What does the `import pandas as pd` statement do?
A) Imports the pandas library and renames it as pd for easier use
B) Imports the pandas library and assigns it to a variable pd
C) Imports the pandas package and creates an alias called pd
D) Imports the pandas module and uses it as pd
Y
easier use
@
Question 3:
Which data structure in Pandas is used for one-dimensional labeled data?
A) DataFrame
B) Series
C) Array
D) Dictionary
Page 1 MY SWAYAM
Python for Data Science IIT Kharagpur
Question 4:
What does the `matplotlib.pyplot` library in Python provide?
A) Data analysis tools
B) Machine learning algorithms
C) Data visualization tools
D) Statistical functions
AM
Question 5:
What is the purpose of NumPy in Python for data science?
A) Data visualization
AY
B) Data manipulation and analysis
C) Machine learning algorithms
D) Scientific computing and working with arrays
SW
Question 6:
Y
B) `array([1, 2, 3])`
C) `create.array([1, 2, 3])`
@
D) `np.create([1, 2, 3])`
Page 2 MY SWAYAM
Python for Data Science IIT Kharagpur
Question 7:
In Python, what is the purpose of the `iloc` attribute in Pandas?
A) It selects rows and columns by index
B) It performs element-wise operations
C) It converts data to a NumPy array
D) It plots data using Matplotlib
AM
Question 8:
Which library provides machine learning algorithms in Python?
A) Pandas
B) NumPy
C) Scikit-Learn
D) Matplotlib
AY
SW
Accepted Answer: C) Scikit-Learn
Question 9:
What is the output of `print(2 3)` in Python?
Y
A) 5
B) 8
M
C) 6
D) 2
@
Accepted Answer: B) 8
Page 3 MY SWAYAM
Python for Data Science IIT Kharagpur
Question 10:
What does the `random` module in Python provide?
A) Functions for generating random numbers and samples
B) Functions for mathematical calculations
C) Functions for sorting data
D) Functions for working with strings
AM
Question 11:
Which of the following is used for conditional filtering in Pandas
DataFrame?
A) `select()`
B) `filter()`
C) `query()`
AY
SW
D) `search()`
Question 12:
Y
Page 4 MY SWAYAM
Python for Data Science IIT Kharagpur
Question 13:
Which of the following is used for missing data imputation in Pandas
DataFrame?
A) `replace()`
B) `impute()`
C) `fill()`
D) `fillna()`
AM
Question 14:
What does the `head()` method in Pandas DataFrame do?
A) Displays the last few rows of the DataFrame
AY
B) Displays the first few rows of the DataFrame
C) Removes duplicate rows from the DataFrame
D) Calculates the mean of each column in the DataFrame
SW
Question 15:
Which of the following is used to install external packages in Python?
Y
A) `install package_name`
M
B) `get package_name`
C) `import package_name`
D) `pip install package_name`
@
Page 5 MY SWAYAM
Python for Data Science IIT Kharagpur
Question 16:
Which library is commonly used for advanced data visualization in Python?
A) Pandas
B) Seaborn
C) NumPy
D) Scikit-Learn
AM
Subscribe for
PART 2 AND 3
AY MY SWAYAM
SW
HAPPY LEARNING
THANK YOU.
@
Page 6 MY SWAYAM