NEW
Font size
WorksheetsExploring Python Libraries
Total questions: 20
Worksheet time: 10mins
What is the primary purpose of the Pandas library?
Machine learning model training and evaluation.
Web scraping and data extraction from APIs.
Data analysis and manipulation of structured data.
Data visualization and presentation of unstructured data.
How do you read a CSV file into a Pandas DataFrame?
Use `pd.load_csv('file_path.csv')` to read a CSV file into a DataFrame.
Use `pd.read_csv('file_path.csv')` to read a CSV file into a DataFrame.
Utilize `pd.open_csv('file_path.csv')` to load a CSV file into a DataFrame.
Read the CSV file with `pd.import_csv('file_path.csv')` into a DataFrame.
What function would you use to calculate the mean of a DataFrame column in Pandas?
dataframe['column_name'].mean()
dataframe['column_name'].sum()
dataframe.mean('column_name')
dataframe['column_name'].average()
Which method is used to visualize data in a scatter plot using Matplotlib?
plot
scatter
line
bar
How can you change the size of a figure in Matplotlib?
Call plt.resize_figure(width, height) to change the size of the figure.
Use plt.set_size(width, height) to adjust the figure size.
Use plt.figure(figsize=(width, height)) to set the figure size.
Change the figure size by modifying the axes dimensions directly.
What is the purpose of the 'imshow' function in Matplotlib?
To display image data in a figure.
To create a 3D plot.
To save image data to a file.
To apply filters to image data.
How do you convert a list to a NumPy array?
numpy.array(your_list)
list.to_numpy()
convert_list_to_array(list)
array(list)
What is the main advantage of using NumPy over regular Python lists?
NumPy offers better performance and efficiency for numerical computations.
NumPy requires more memory than Python lists for numerical data.
NumPy does not support multi-dimensional arrays.
NumPy is slower than regular Python lists for all operations.
How can you perform element-wise operations on NumPy arrays?
Use arithmetic operators or NumPy functions for element-wise operations.
Convert arrays to lists before performing operations.
Perform operations only on the first element of the arrays.
Use only integer values for operations.
What is the primary function of the OpenCV library?
To create 3D graphics
To provide tools for computer vision tasks.
To manage databases
To develop mobile applications
How do you read an image using OpenCV?
Open the image using cv2.open('image_path') method.
Use cv2.imread('image_path') to read an image.
Read an image with imread('image_path') function.
Use cv2.load('image_path') to read an image.
What function would you use to display an image in OpenCV?
cv2.imshow()
cv2.showImage()
cv2.render()
cv2.display()
How can you convert a color image to grayscale using OpenCV?
Use cv2.convertColor(image, cv2.COLOR_RGB2GRAY)
Use cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
Use cv2.split(image) to isolate channels
Apply cv2.threshold(image, 128, 255, cv2.THRESH_BINARY)
What is Seaborn primarily used for?
Web development frameworks
Data storage and management
Machine learning algorithms
Data visualization and statistical graphics.
How do you create a heatmap using Seaborn?
Use plt.heatmap(data) to create a heatmap in Seaborn.
Use sns.visualize(data) to generate a heatmap in Seaborn.
Use sns.heatmap(data) to create a heatmap in Seaborn.
Create a heatmap with sns.plot(data) in Seaborn.
What is the difference between Matplotlib and Seaborn?
Matplotlib is only for 3D plots, while Seaborn is for 2D plots.
Matplotlib is for detailed customization of plots, while Seaborn simplifies statistical visualizations with better aesthetics.
Matplotlib is easier to use than Seaborn for all types of visualizations.
Seaborn is a library for data manipulation, while Matplotlib is for data storage.
How can you customize the color palette in Seaborn?
Change the `theme` setting to alter the color scheme.
Modify the `style` parameter to adjust colors.
Use `set_color()` to change colors in Seaborn.
Use `set_palette()` or `color_palette()` to customize the color palette in Seaborn.
What function in Pandas is used to group data?
filter
groupby
aggregate
sort
How do you handle missing values in a Pandas DataFrame?
Use 'interpolate()' to ignore missing values.
Use 'concat()' to merge DataFrames with missing values.
Use 'replace()' to remove missing values.
Use 'dropna()' to remove or 'fillna()' to replace missing values.
What is the purpose of the 'plt.show()' function in Matplotlib?
To clear the current figure.
To display the created plots and figures.
To create a new figure window.
To save the plots to a file.
