Loading

Quipoin Menu

Learn • Practice • Grow

python-for-ai / Series and DataFrames
mcq
Direction: Choose the correct option

Q1.

What is a pandas Series?
A. A dictionary
B. A list
C. A two-dimensional labeled data structure
D. A one-dimensional labeled array
Direction: Choose the correct option

Q2.

How do you create a DataFrame from a dictionary of lists?
A. pd.DataFrame({'col1': 1})
B. pd.DataFrame.from_dict({'col1': [1,2]})
C. Both A and B
D. pd.DataFrame({'col1': [1,2], 'col2': [3,4]})
Direction: Choose the correct option

Q3.

What does `df.head()` do?
A. Shows summary statistics
B. Shows column names
C. Shows the last 5 rows
D. Shows the first 5 rows
Direction: Choose the correct option

Q4.

How do you select a column 'name' from a DataFrame?
A. Both A and B
B. df['name']
C. df.column('name')
D. df.name
Direction: Choose the correct option

Q5.

What is the output of `df.shape`?
A. Number of columns
B. (columns, rows)
C. Number of rows
D. (rows, columns)
Direction: Choose the correct option

Q6.

How do you get the index of a DataFrame?
A. df.axes
B. df.columns
C. df.index
D. df.values
Direction: Choose the correct option

Q7.

What does `df.info()` display?
A. First 5 rows
B. Column names only
C. Summary statistics
D. Data types and memory usage
Direction: Choose the correct option

Q8.

How do you create a DataFrame from a CSV file?
A. pd.load_csv('file.csv')
B. pd.import_csv('file.csv')
C. pd.read_csv('file.csv')
D. pd.read('file.csv')
Direction: Choose the correct option

Q9.

What does `df.describe()` produce?
A. Data types
B. Descriptive text
C. Column names
D. Summary statistics for numeric columns
Direction: Choose the correct option

Q10.

How do you get the number of unique values in a column?
A. df['col'].unique()
B. len(df['col'].unique())
C. Both A and C
D. df['col'].nunique()