30 Questions
What data structure in pandas is a 1-dimensional array?
Series
What is the minimum number of arguments required to pass in a pandas Series?
1
Which of the following is not a feature of a pandas Series?
Multiple columns
What is the full form of NaN in pandas?
Not a Number
What package is required to create a pandas Series?
Pandas
What data structure can be used to analyze data in pandas?
Both
What is the output of the following code: import pandas as pd; s = pd.Series(5, index=[0, 1, 2, 3]); print(s)?
0 5
What is the minimum number of arguments required to pass in a pandas Series?
1
What can be used to create a pandas Series?
All of them
What is the output of the following code: import pandas as pd; s = pd.Series(5, index=[0, 1, 2, 3]); print(s)
?
0 5 1 5 2 5 3 5 dtype: int64
What does NaN stand for in pandas?
Not a Number
What is the output of the following code: import pandas as pd; s = pd.Series([1,2,3]); t = pd.Series([1,2,4]); u = s-t; print(u)
?
0 0 1 0 2 -1 dtype: int64
What is a DataFrame in Pandas?
A two-dimensional array with heterogeneous data
What is the purpose of the drop() function in a DataFrame?
To delete a column or row
Which function can be used to read a dataset from a large text file?
read_csv
What can be used to create a DataFrame in Pandas?
All of the above
What is the full form of a CSV file?
Comma Separated Value
What is the correct Pandas syntax to read in a CSV file and assign it to a DataFrame?
df = pd.read_csv('file.csv')
What does the line of code 'df.dropna()' do?
Drops NaN values
What is the default number of rows returned by the head() function in a Series?
5
What is the difference between a DataFrame and a Series?
A DataFrame is two-dimensional, while a Series is one-dimensional
What does the iteritems() function do?
Returns a tuple with the column name and the content as a Series
What is the dimension of a Series in Pandas?
1 Dimensional Array
What is the minimum number of arguments required to pass in a Pandas Series?
1
Which of the following statements will display the last few rows of the dataframe?
Print(df.tail())
Which of the following commands will delete the 'rank2' row from the dataframe?
df.drop('rank2')
What is the correct way to add a new column 'Marks' to the dataframe with the values 12, 22, 21, 24?
df['marks'] = [12, 22, 21, 24]
What is the attribute used to specify column labels in a DataFrame?
columns
Which of the following functions can be used to extract a row or column from a DataFrame?
All of the above
What is the number of arguments required by the insert
function in a DataFrame?
3
Test your skills in performing various operations on Pandas DataFrames, including printing, deleting rows, and adding new columns.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free