WorksheetsNumPy Worksheet
Total questions: 20
Worksheet time: 13mins
What does NumPy stand for?
New Python
Numerical Python
Numeral Processor
Nested Python
Who created NumPy in 2005?
Wes McKinney
Travis Oliphant
Guido van Rossum
John D. Hunter
Which of the following is NOT a domain NumPy provides functions for?
Linear algebra
Fourier transform
Matrices
Graphical user interfaces
Why are NumPy arrays up to 50x faster than Python lists?
They support different data types per element
They are stored in contiguous memory
They are slower for general-purpose objects
They simulate 2D/3D with nested lists
What is the core array object in NumPy called?
list
ndarray
tuple
dict
Which NumPy function creates an array filled with zeros of shape (3,3)?
np.ones((3,3))
np.zeros((3,3))
np.full((3,3), 1)
np.eye(3)
What does np.arange(0, 10, 2) return?
array([0., 0.25, 0.5, 0.75, 1.])
array([0, 2, 4, 6, 8])
array([10., 31.62, 100., 316.23, 1000.])
array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]])
What is 2 + 2?
Fill in the blank: The capital of France is ____.
Paris
London
Berlin
Rome
Which method creates a DataFrame from a dictionary of lists?
pd.read_csv()
pd.DataFrame({'col1': [1,2], 'col2': [3,4]})
pd.Series([1,2])
np.array()
How do you read a CSV file into a DataFrame?
pd.to_csv('file.csv')
pd.read_json('file.csv')
pd.read_csv('file.csv')
pd.write_csv('file.csv')
Which Pandas feature handles missing data represented as NaN?
Easy handling of missing data
Fourier transform
Linear algebra
Identity matrix creation
What does boolean indexing do in Pandas filtering?
Sorts data by columns
Selects rows based on conditions
Merges DataFrames
Creates Series from dict
Which method selects specific columns from a DataFrame?
df.loc[['A','B']]
df[['A','B']]
df.groupby(['A','B'])
df.sort_values(['A','B'])
How do you access rows by label in Pandas?
df.iloc[0]
df.loc['label']
df[0]
df.sum()
Which method groups data by one or more columns in Pandas?
df.sort_values()
df.groupby()
df.merge()
df.filter()
What does df.sort_values(by='Score') do?
Aggregates scores
Sorts the DataFrame by 'Score' column
Filters rows with 'Score'
Merges on 'Score'
Which aggregation function computes the average of a column?
df['col'].sum()
df['col'].mean()
df['col'].min()
df['col'].count()
How do you merge two DataFrames on a common column 'Name'?
pd.concat(df1, df2)
pd.merge(df1, df2, on='Name')
df1.groupby('Name')
df1.sort_values('Name')
What does df.to_csv('output.csv') do?
Reads a CSV file
Saves the DataFrame to a CSV file
Creates a new DataFrame from CSV
Filters the CSV data
