Wednesday, 17 January 2024

How much do you know about Pandas library?



Question 1:

What is Pandas?

a) A species of bear

b) A data manipulation and analysis library in Python

c) A programming language

d) A web development framework


Question 2:

Which of the following data structures is used to store one-dimensional labeled data in Pandas?

a) Series

b) DataFrame

c) Array

d) List


Question 3:

How can you import the Pandas library in Python?

a) import panda

b) import pandas as pd

c) from pandas import *

d) import pd


Question 4:

What is the primary purpose of a Pandas DataFrame?

a) Storing only numerical data

b) Storing two-dimensional labeled data

c) Storing images and multimedia files

d) Storing text data


Question 5:

Which Pandas function is used to read a CSV file into a DataFrame?

a) read_csv()

b) load_csv()

c) import_csv()

d) read_file()


Question 6:

How can you access a specific column in a Pandas DataFrame?

a) By using the column's index

b) By using the column's label or name

c) By using the row number

d) By using the DataFrame's index


Question 7:

What does the head() function do in Pandas?

a) Prints the first few rows of a DataFrame

b) Prints the last few rows of a DataFrame

c) Prints a summary statistics of the DataFrame

d) Prints the shape of the DataFrame


Question 8:

Which Pandas method is used to check for missing values in a DataFrame?

a) find_missing()

b) check_missing()

c) missing_values()

d) isnull()


Question 9:

What is the purpose of the iloc method in Pandas?

a) Selects columns based on their labels

b) Selects rows and columns based on their integer positions

c) Performs element-wise operations on a DataFrame

d) Checks for duplicate values in a DataFrame


Question 10:

How can you drop a column named "Column_A" from a Pandas DataFrame called df?

a) df.remove("Column_A")

b) df.drop("Column_A", axis=1)

c) df.delete("Column_A")

d) df.remove_column("Column_A")


Question 11:

Which Pandas function is used to filter rows based on a condition?

a) filter_rows()

b) select_rows()

c) filter()

d) query()


Question 12:

In Pandas, what is the purpose of the groupby() function?

a) Groups data based on unique values in a column

b) Reverses the order of rows in a DataFrame

c) Computes the mean of each column

d) Reshapes a DataFrame into a pivot table


Question 13:

How can you rename a specific column in a Pandas DataFrame?

a) rename_column()

b) change_column_name()

c) df.rename()

d) df.change_name()


Question 14:

What does the merge() function in Pandas do?

a) Merges two DataFrames based on a specified column or index

b) Adds a new column to a DataFrame

c) Sorts the rows of a DataFrame

d) Reshapes a DataFrame into a long format


Question 15:

Which Pandas function is used to pivot a DataFrame?

a) pivot()

b) reshape()

c) pivot_table()

d) transpose()


Question 16:

What is the purpose of the to_csv() function in Pandas?

a) Converts a DataFrame to a CSV file

b) Converts a CSV file to a DataFrame

c) Checks if a CSV file is valid

d) Counts the number of occurrences of each value in a DataFrame


Question 17:

Which method is used to fill missing values in a Pandas DataFrame with a specific value?

a) fillna()

b) fill_missing()

c) replace()

d) impute()


Question 18:

How can you sort a Pandas DataFrame based on a specific column?

a) df.sort_by("column_name")

b) df.sort("column_name")

c) df.sort_values("column_name")

d) df.order_by("column_name")


Question 19:

What is the purpose of the pivot_table() function in Pandas?

a) Pivots a DataFrame from long to wide format

b) Computes the sum of each column in a DataFrame

c) Transposes a DataFrame

d) Aggregates data based on one or more columns


Question 20:

Which Pandas function is used to calculate summary statistics of a DataFrame?

a) describe()

b) summary()

c) stats()

d) analyze()


Answer : 

Question 1: b) A data manipulation and analysis library in Python
Question 2: a) Series
Question 3: b) import pandas as pd
Question 4: b) Storing two-dimensional labeled data
Question 5: a) read_csv()
Question 6: b) By using the column's label or name
Question 7: a) Prints the first few rows of a DataFrame
Question 8: d) isnull()
Question 9: b) Selects rows and columns based on their integer positions
Question 10: b) df.drop("Column_A", axis=1)
Question 11: d) query()
Question 12: a) Groups data based on unique values in a column
Question 13: c) df.rename()
Question 14: a) Merges two DataFrames based on a specified column or index
Question 15: c) pivot_table()
Question 16: a) Converts a DataFrame to a CSV file
Question 17: a) fillna()
Question 18: c) df.sort_values("column_name")
Question 19: d) Aggregates data based on one or more columns
Question 20: a) describe()

0 Comments:

Post a Comment

Popular Posts

Categories

100 Python Programs for Beginner (51) AI (34) Android (24) AngularJS (1) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (173) C (77) C# (12) C++ (82) Course (67) Coursera (226) Cybersecurity (24) data management (11) Data Science (128) Data Strucures (8) Deep Learning (20) Django (14) Downloads (3) edx (2) Engineering (14) Excel (13) Factorial (1) Finance (6) flask (3) flutter (1) FPL (17) Google (34) Hadoop (3) HTML&CSS (47) IBM (25) IoT (1) IS (25) Java (93) Leet Code (4) Machine Learning (59) Meta (22) MICHIGAN (5) microsoft (4) Nvidia (3) Pandas (4) PHP (20) Projects (29) Python (932) Python Coding Challenge (358) Python Quiz (22) Python Tips (2) Questions (2) R (70) React (6) Scripting (1) security (3) Selenium Webdriver (3) Software (17) SQL (42) UX Research (1) web application (8) Web development (2) web scraping (2)

Followers

Person climbing a staircase. Learn Data Science from Scratch: online program with 21 courses