Which Python data structure is most appropriate for storing column-oriented tabular data with labeled rows and columns?
Pced Fundamentals Category
Question · Easy
What is the canonical alias used when importing pandas in data-analysis code?
Which built-in Python function reads a text file line by line in a memory-efficient way using a context manager?
Tech Exam Prep Podcast
Listen on Spotify
Podcast
Which standard-library module is used to read and write CSV files when you do not want to load the file into a DataFrame?
What does `np.arange(2, 10, 2)` return?
Pced Numpy Category
How many elements does `np.linspace(0, 1, 5)` produce?
What is the shape of `np.zeros((3, 4))`?
Which ndarray attribute returns the number of dimensions of an array?
Given `a = np.array([[1, 2, 3], [4, 5, 6]])`, what is `a.shape`?
Which dtype does `np.array([1, 2, 3, 4])` use by default on a 64-bit system?
Question · Medium
Given `a = np.arange(12).reshape(3, 4)`, what does `a[1, 2]` return?
Given `a = np.arange(10)`, what does `a[2:8:2]` return?
Given `a = np.array([10, 20, 30, 40])`, what does `a[a > 15]` return?
What is the difference between `arr.ravel()` and `arr.flatten()`?
Question · Hard
Given a NumPy array of shape (3, 4), which call produces a transposed array of shape (4, 3)?
What does `np.arange(6).reshape(2, 3) + np.array([10, 20, 30])` produce?
Which broadcasting rule allows `np.zeros((3, 4)) + np.ones((4,))` to succeed?
Given `a = np.array([[1, 2], [3, 4]])`, what does `a.sum(axis=0)` return?
Which NumPy function returns the index of the maximum value in an array?
What does `np.where(a > 0, 1, -1)` do for an integer array `a`?
What does `np.array([3, 1, 2]).cumsum()` return?
Which of the following correctly computes the sample standard deviation (Bessel-corrected) of a NumPy array?
Pced Stats Category
Which pandas object is 1-dimensional with an index?
Pced Pandas Category
Which call reads a comma-separated file into a DataFrame, treating the first row as headers?
Which argument in `pd.read_csv` lets you read only specific columns from a wide CSV file?
Which method writes a DataFrame to a CSV file without including the index column?
What is the difference between `df.loc` and `df.iloc`?
Which expression returns the first 3 rows of a DataFrame `df`?
How do you select all rows where the 'age' column is greater than 30?
Which method tests for missing values in a pandas Series or DataFrame?
Which call removes any row that contains at least one missing value?
Which call replaces every missing value in column 'price' with the column's median?
Which method removes duplicate rows from a DataFrame?
Which call renames the column 'old_name' to 'new_name' WITHOUT modifying df in place?
Which call converts the column 'date_str' from string to datetime?
After `df['date'] = pd.to_datetime(df['date'])`, how do you extract the year of each row?
Which call computes the mean of column 'sales' for each value of column 'region'?
Which call computes BOTH the mean AND the sum of 'sales' per 'region' in one expression?
Which groupby method broadcasts each group's aggregate back to its original row positions, preserving DataFrame shape?
Which function performs an SQL-style INNER join between two DataFrames on the 'id' column?
Which call stacks two DataFrames vertically, aligning columns by name?
Which call reshapes a long-format DataFrame so each unique value of 'category' becomes its own column, with 'value' as the cell content?
What does `df.melt(id_vars=['id'], value_vars=['col1', 'col2'])` produce?
Which call sorts a DataFrame by the 'price' column in descending order?
Which call changes the dtype of column 'count' to integer?
Which function summarises a numeric DataFrame's count, mean, std, min, quartiles, and max in one call?
What does `df.info()` show?
Loading more…